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

Add endsWith()

This commit is contained in:
Daniel St. Jules
2013-07-18 22:56:49 -04:00
parent e37cc8c72b
commit 493a194612
3 changed files with 70 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ A PHP library with a variety of string manipulation functions with multibyte sup
* [padRight](#padright)
* [padBoth](#padboth)
* [startsWith](#startswith)
* [endsWith](#endswith)
* [Tests](#tests)
* [License](#license)
@@ -249,15 +250,23 @@ By default, the comparison is case-sensitive, but can be made insensitive
by setting $caseSensitive to false.
```php
S::startsWith('FÒÔ bàřs', 'fòô bàř', false, 'UTF-8'), // true
S::startsWith('FÒÔ bàřs', 'fòô bàř', false, 'UTF-8'); // true
```
##### endsWith
S::endsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]])
Returns true if the string $str ends with $substring, false otherwise.
By default, the comparison is case-sensitive, but can be made insensitive
by setting $caseSensitive to false.
```php
S::endsWith('FÒÔ bàřs', 'àřs', true, 'UTF-8'); // true
```
## TODO
**endsWith**
**char** => chr
**toSpaces**
**toTabs**