import org.apache.commons.lang.CharSetUtils;
public class MainClass {
public static void main(String[] args) {
//Specified characters deleted.
System.out.println("Delete B and o = " +
CharSetUtils.delete("BorisBecker", "Bo"));
System.out.println("Delete B,o,k,e and r = " +
CharSetUtils.delete("BorisBecker", new String[] { "Bo", "ker" }));
}
}
|