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

Add contains()

This commit is contained in:
Daniel St. Jules
2013-07-22 00:52:45 -04:00
parent feb4c5a36d
commit 8ddb4b91b5
3 changed files with 59 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ A PHP library with a variety of string manipulation functions with multibyte sup
* [endsWith](#endswith)
* [toSpaces](#tospaces)
* [toTabs](#totabs)
* [slugify](#slugify)
* [contains](#contains)
* [Tests](#tests)
* [License](#license)
@@ -303,12 +305,22 @@ dashes. The string is also converted to lowercase.
S::slugify('Using strings like fòô bàř') // 'using-strings-like-foo-bar'
```
##### contains
S::contains(string $haystack, string $needle [, string $encoding ])
Returns true if $haystack contains $needle, false otherwise.
```php
S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8') // true
```
## TODO
**contains**
**between**
**surround**
**replace** => substr_replace
**insert**
@@ -337,6 +349,8 @@ S::slugify('Using strings like fòô bàř') // 'using-strings-like-foo-bar'
**isJson**
**isMultibyte**
## Tests
[![Build Status](https://travis-ci.org/danielstjules/Stringy.png)](https://travis-ci.org/danielstjules/Stringy)