Count the number of non-overlapping occurrences of substr in s.
Example:
assert (Strings.count ("abcabc", "abc") == 2);
assert (Strings.count ("hello", "xyz") == 0);
| s |
the string to search in. |
| substr |
the substring to count. |
|
number of occurrences. |