static public String remove ( String s , String sub ) { int len = sub . length ( ) ; int pos ; while ( 0 <= ( pos = s . indexOf ( sub ) ) ) { s = s . substring ( 0 , pos ) + s . substring ( pos + len ) ; } return s ; }
Remove all occurrences of the substring sub in the string s .