Method String.count()
- Method count
int count(string haystack, string needle)
- Description
Count the number of non-overlapping times the string needle occurs in the string haystack. The special cases for the needle
""
is that it occurs one time in the empty string, zero times in a one character string and between every character (length-1) in any other string.- See also