public static String removeChars ( String s , String chars ) { int i = s . length ( ) ; StringBuilder sb = new StringBuilder ( i ) ; for ( int j = 0 ; j < i ; j ++ ) { char c = s . charAt ( j ) ; if ( chars . indexOf ( c ) == - 1 ) { sb . append ( c ) ; } } return sb . toString ( ) ; }
Removes all characters contained in provided string .