Java Utililty Methods String Strip

List of utility methods to do String Strip

Description

The list of methods to do String Strip are organized into topic(s).

Method

StringstripTags(String html)
Remove all text contained within "< >" tags.
StringBuilder stripped = new StringBuilder();
while (html.length() > 0) {
    int idx = html.indexOf("<");
    if (idx < 0) {
        stripped.append(html.trim());
        break;
    String text = html.substring(0, idx);
...
StringstripTags(String in)
This method takes a string and strips out all tags except
tags while still leaving the tag body intact.
if (in == null) {
    return null;
char ch;
int i = 0;
int last = 0;
char[] input = in.toCharArray();
int len = input.length;
...
StringstripTrailingChar(String input, char c)
Removes a single character from the end of a string if it matches.
if (input == null)
    return null;
if (input.isEmpty())
    return input;
char[] charArray = input.toCharArray();
if (charArray[charArray.length - 1] == c) {
    return new String(Arrays.copyOf(charArray, charArray.length - 1));
} else {
...
StringstripUnsupportedChars(String str)
strip Unsupported Chars
if (isEmpty(str)) {
    return str;
return str.replaceAll(":", "");