Count the number of occurrences of a substring in the string.
Twine\Str::count( string $string ) : int
$string | The substring to count |
$string = new Twine\Str('How much wood could a woodchuck chuck if a woodchuck could chuck wood?');
$string->count('wood'); // Returns 4