android/guava/src/com/google/common/base/CharMatcher.java
public String removeFrom(CharSequence sequence) {
    String string = sequence.toString();
    int pos = indexIn(string);
    if (pos == -1) {
      return string;
    }

    char[] chars = string.toCharArray();
    int spread = 1;

    // This unusual loop comes from extensive benchmarking
    OUT:
    while (true) {
      pos++;
      while (true) {
        if (pos == chars.length) {
          break OUT;
        }
        if (matches(chars[pos])) {
          break;
        }
        chars[pos - spread] = chars[pos];
        pos++;
      }
      spread++;
    }
    return new String(chars, 0, pos - spread);
  }
public String removeFrom(CharSequence sequence) {
    String string = sequence.toString();
    int pos = indexIn(string);
    if (pos == -1) {
      return string;
    }

    char[] chars = string.toCharArray();
    int spread = 1;

    // This unusual loop comes from extensive benchmarking
    OUT:
    while (true) {
      pos++;
      while (true) {
        if (pos == chars.length) {
          break OUT;
        }
        if (matches(chars[pos])) {
          break;
        }
        chars[pos - spread] = chars[pos];
        pos++;
      }
      spread++;
    }
    return new String(chars, 0, pos - spread);
  }
public String removeFrom ( CharSequence sequence ) { String string = sequence . toString ( ) ; int pos = indexIn ( string ) ; if ( pos == - 1 ) { return string ; } char [ ] chars = string . toCharArray ( ) ; int spread = 1 ; // This unusual loop comes from extensive benchmarking OUT : while ( true ) { pos ++ ; while ( true ) { if ( pos == chars . length ) { break OUT ; } if ( matches ( chars [ pos ] ) ) { break ; } chars [ pos - spread ] = chars [ pos ] ; pos ++ ; } spread ++ ; } return new String ( chars , 0 , pos - spread ) ; }
Returns a string containing all non-matching characters of a character sequence, in order. For
example:

<pre>{@code
CharMatcher.is('a').removeFrom("bazaar")
}</pre>

... returns {@code "bzr"}.
Returns a string containing all non - matching characters of a character sequence in order . For example :