Professional Documents
Culture Documents
Word Count Example
Word Count Example
StringUtils;
public class WordCountExample
{
public static void main(String[] args)
{
String string = "How r you?R you fine?Where are you going?";
System.out.println(StringUtils.countMatches(string,"you")+ " occurrences
of the word 'you' in '" + string +
"' is found.");
}
}