string_count [function]
string_count( string str, string substr, bool overlap = false )
returns the number of substrings substr
found in string str
- if
overlap
is true, function does not skip substrings when they are found
string_count( "abababa", "aba" ); // int 2 string_count( "abababa", "aba", true ); // int 3