1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-09-01 09:03:03 +02:00

Added $caseSensitive to count()

This commit is contained in:
Daniel St. Jules
2013-09-14 14:57:18 -04:00
parent d862f9c24c
commit 41ea0277b2
6 changed files with 40 additions and 18 deletions

View File

@@ -184,12 +184,13 @@ S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8')
#### count
$stringy->count(string $substring)
$stringy->count(string $substring [, boolean $caseSensitive = true ])
S::count(string $str, string $substring [, string $encoding ])
S::count(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]])
Returns the number of occurrences of $substring in the given string. An alias for
mb_substr_count()
Returns the number of occurrences of $substring in the given string.
By default, the comparison is case-sensitive, but can be made insensitive
by setting $caseSensitive to false.
```php
S::create('Ο συγγραφέας είπε', 'UTF-8')->count('α');