public static String removeChars(String str,String oldchars){
  int pos=indexOfChars(str,oldchars);
  if (pos == -1) {
    return str;
  }
  StringBuilder buf=new StringBuilder();
  int start=0;
  do {
    buf.append(str.substring(start,pos));
    start=pos + 1;
    pos=indexOfChars(str,oldchars,start);
  }
 while (pos != -1);
  if (start < str.length()) {
    buf.append(str.substring(start));
  }
  return buf.toString();
}

public static String removeChars ( String str , String oldchars ) { int pos = indexOfChars ( str , oldchars ) ; if ( pos == - 1 ) { return str ; } StringBuilder buf = new StringBuilder ( ) ; int start = 0 ; do { buf . append ( str . substring ( start , pos ) ) ; start = pos + 1 ; pos = indexOfChars ( str , oldchars , start ) ; } while ( pos != - 1 ) ; if ( start < str . length ( ) ) { buf . append ( str . substring ( start ) ) ; } return buf . toString ( ) ; }
remove any occurrances of ' oldchars ' in ' str ' . example : removechars ( " hello , world ! " , " , ! " ) returns " hello world "
