import org.apache.commons.lang.CharSetUtils;
public class MainClass {
public static void main(String[] args) {
//Count all occurrences of all the characters specified.
System.out.println("B and o count = " +
CharSetUtils.count("BorisBecker", "Bo"));
System.out.println("B,o,k,e and r count = " +
CharSetUtils.count("BorisBecker", new String[] { "Bo", "ker" }));
}
}
|