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

Add reverse()

This commit is contained in:
Daniel St. Jules
2013-07-23 01:11:13 -04:00
parent 1e2f49128b
commit 4bb791e318
3 changed files with 52 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ A PHP library with a variety of string manipulation functions with multibyte sup
* [surround](#surround)
* [insert](#insert)
* [truncate](#truncate)
* [reverse](#reverse)
* [Tests](#tests)
* [License](#license)
@@ -340,7 +341,7 @@ S::insert('fòô bà', 'ř', 6, 'UTF-8'); // 'fòô bàř'
##### truncate
S::truncate(string $str, int $length, [, string $substring = '' [, string $encoding ] ])
S::truncate(string $str, int $length, [, string $substring = '' [, string $encoding ]])
Truncates the string to a given length, while ensuring that it does not
chop words. If $substring is provided, and truncating occurs, the string
@@ -351,12 +352,18 @@ exceeding the desired length.
S::truncate('What are your plans today?', 22, '...'); // 'What are your plans...'
```
##### reverse
S::reverse(string $str, [, string $encoding ])
Reverses a string. A multibyte version of strrev.
```php
S::reverse('', 'UTF-8'); //
```
## TODO
**wordWrap** => wordwrap
**reverse** => strrev
**shuffle** => str_shuffle
**explode** => explode
@@ -369,8 +376,6 @@ S::truncate('What are your plans today?', 22, '...'); // 'What are your plans...
**wordCount** => str_word_count
**isJson**
**isMultibyte**
## Tests