static public String remove ( String s , int c ) { if ( 0 > s . indexOf ( c ) ) { // none return s ; } StringBuilder buff = new StringBuilder ( s ) ; int i = 0 ; while ( i < buff . length ( ) ) { if ( buff . charAt ( i ) == c ) { buff . deleteCharAt ( i ) ; } else { i ++ ; } } return buff . toString ( ) ; }
Remove all occurrences of the character c in the string s .