static public void remove ( StringBuilder sb , String out ) { int i = 0 ; while ( i < sb . length ( ) ) { int c = sb . charAt ( i ) ; boolean ok = true ; for ( int j = 0 ; j < out . length ( ) ; j ++ ) { if ( out . charAt ( j ) == c ) { sb . delete ( i , i + 1 ) ; ok = false ; break ; } } if ( ok ) i ++ ; } }
Remove any of the characters in out from sb