1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-12 16:24:00 +02:00

Added containsAll and containsAny to readme

This commit is contained in:
Daniel St. Jules
2014-10-14 23:25:43 -07:00
parent 8e16ad472d
commit 3cc12c2ee7

View File

@@ -15,6 +15,8 @@ PHP 5.3+ and HHVM. Inspired by underscore.string.js.
* [chars](#chars)
* [collapseWhitespace](#collapsewhitespace)
* [contains](#contains)
* [containsAll](#containsall)
* [containsAny](#containsany)
* [countSubstr](#countsubstr)
* [create](#create)
* [dasherize](#dasherize)
@@ -249,6 +251,36 @@ S::create('Ο συγγραφέας είπε', 'UTF-8')->contains('συγγραφ
S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8'); // true
```
#### containsAll
$stringy->containsAll(array $needles [, boolean $caseSensitive = true ])
S::containsAll(string $haystack, array $needles [, boolean $caseSensitive = true [, string $encoding ]])
Returns true if the string contains all $needles, false otherwise. By
default the comparison is case-sensitive, but can be made insensitive by
setting $caseSensitive to false.
```php
S::create('Str contains foo and bar')->containsAll(array('foo', 'bar'));
S::containsAll('Str contains foo and bar', array('foo', 'bar')); // true
```
#### containsAny
$stringy->containsAny(array $needles [, boolean $caseSensitive = true ])
S::containsAny(string $haystack, array $needles [, boolean $caseSensitive = true [, string $encoding ]])
Returns true if the string contains any $needles, false otherwise. By
default the comparison is case-sensitive, but can be made insensitive by
setting $caseSensitive to false.
```php
S::create('Str contains foo')->containsAny(array('foo', 'bar'));
S::containsAny('Str contains foo', array('foo', 'bar')); // true
```
#### countSubstr
$stringy->countSubstr(string $substring [, boolean $caseSensitive = true ])