CharSetUtils: delete(String str, String[] set) (2)
/*
Delete B and o = risecker
Delete B,o,k,e and r = isc
*/
import org.apache.commons.lang.CharSetUtils;
public class CharSetUtilsTrial {
public static void main(String[] args) {
// Specified characters deleted.
System.out.println("Delete B and o = " + CharSetUtils.delete("BorisBecker", "Bo")); // risecker
System.out.println("Delete B,o,k,e and r = "
+ CharSetUtils.delete("BorisBecker", new String[] { "Bo", "ker" })); // isc
}
}
Apache-Common-Lang.zip( 248 k)Related examples in the same category