Answers for "java number of occurences of words int string"

0

find number of occurrences of a substring in a string java

public static int count(String str, String target) {
    return (str.length() - str.replace(target, "").length()) / target.length();
}
Posted by: Guest on October-29-2020

Code answers related to "java number of occurences of words int string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language