Android 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

StringstripSuffixIgnoreCase(String str, String suffix)
Case insensitive version of stripSuffix.
return endsWithIgnoreCase(str, suffix) ? str.substring(0,
        str.length() - suffix.length()) : null;
StringstripSuffix(String str, String suffix)
Give me a string and a potential suffix, and I return the string before the suffix if the suffix matches, else null.
return str.endsWith(suffix) ? str.substring(0, str.length()
        - suffix.length()) : null;
StringstripPrefixIgnoreCase(String str, String prefix)
Case insensitive version of stripPrefix.
return startsWithIgnoreCase(str, prefix) ? str.substring(prefix
        .length()) : null;
StringstripPrefix(String str, String prefix)
Give me a string and a potential prefix, and I return the string following the prefix if the prefix matches, else null.
return str.startsWith(prefix) ? str.substring(prefix.length())
        : null;
StringstripPrefixIgnoreCase(String str, String prefix)
Case insensitive version of stripPrefix.
return startsWithIgnoreCase(str, prefix) ? str.substring(prefix
        .length()) : null;
StringstripPrefix(String str, String prefix)
Give me a string and a potential prefix, and I return the string following the prefix if the prefix matches, else null.
return str.startsWith(prefix) ? str.substring(prefix.length())
        : null;
StringstripSuffix(String str, String suffix)
Give me a string and a potential suffix, and I return the string before the suffix if the suffix matches, else null.
return str.endsWith(suffix) ? str.substring(0, str.length()
        - suffix.length()) : null;
StringstripSuffixIgnoreCase(String str, String suffix)
Case insensitive version of stripSuffix.
return endsWithIgnoreCase(str, suffix) ? str.substring(0,
        str.length() - suffix.length()) : null;
Stringstrip(String str, String stripChars)
strip
if (isEmpty(str)) {
    return str;
String srcStr = str;
srcStr = stripStart(srcStr, stripChars);
return stripEnd(srcStr, stripChars);
Stringstrip(String str, String stripChars)
strip
if (isEmpty(str)) {
    return str;
str = stripStart(str, stripChars);
return stripEnd(str, stripChars);