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

StringstripCharacter(String inputString, char stripCharacter)
Strip the given String with the given character
return inputString.replaceAll(
        Pattern.quote(Character.toString(stripCharacter)), "");
StringstripCharacters(String inputString, String stripCharacters)
Strip the given String with the given String characters
char[] charArray = stripCharacters.toCharArray();
for (char c : charArray) {
    inputString = inputString.replace(String.valueOf(c), "");
return inputString;
StringstripControlCharacters(Object value)
Strip an Object of it's ISO control characters.
if (value == null) {
    return null;
return stripControlCharacters(value.toString());
StringstripControlCharacters(String value)
Strip a String of it's ISO control characters.
boolean hasControlChars = false;
for (int i = value.length() - 1; i >= 0; i--) {
    if (Character.isISOControl(value.charAt(i))) {
        hasControlChars = true;
        break;
if (!hasControlChars) {
...
StringstripEnd(String str, String stripChars)
strip End
int end;
if (str == null || (end = str.length()) == 0) {
    return str;
if (stripChars == null) {
    while ((end != 0)
            && Character.isWhitespace(str.charAt(end - 1))) {
        end--;
...
StringstripEnd(String str, String stripChars)
strip End
int end;
if (str == null || (end = str.length()) == 0) {
    return str;
if (stripChars == null) {
    while ((end != 0)
            && Character.isWhitespace(str.charAt(end - 1))) {
        end--;
...
StringstripStart(String str, String stripChars)
strip Start
int strLen;
if (str == null || (strLen = str.length()) == 0) {
    return str;
int start = 0;
if (stripChars == null) {
    while ((start != strLen)
            && Character.isWhitespace(str.charAt(start))) {
...
StringstripStart(String str, String stripChars)
strip Start
int strLen;
if (str == null || (strLen = str.length()) == 0) {
    return str;
int start = 0;
if (stripChars == null) {
    while ((start != strLen)
            && Character.isWhitespace(str.charAt(start))) {
...