mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-09-02 01:22:37 +02:00
Add surround and insert
This commit is contained in:
28
README.md
28
README.md
@@ -315,16 +315,28 @@ Returns true if $haystack contains $needle, false otherwise.
|
||||
S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8') // true
|
||||
```
|
||||
|
||||
##### surround
|
||||
|
||||
S::surround(string $str, string $substring)
|
||||
|
||||
Surrounds a string with the given substring.
|
||||
|
||||
```php
|
||||
S::surround(' ͜ ', 'ʘ'); // 'ʘ ͜ ʘ'
|
||||
```
|
||||
|
||||
##### insert
|
||||
|
||||
S::insert(string $str, int $index, string $substring [, string $encoding ])
|
||||
|
||||
Inserts $substring into $str at the $index provided.
|
||||
|
||||
```php
|
||||
S::insert('fòô bà', 'ř', 6, 'UTF-8'); // 'fòô bàř'
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
**between**
|
||||
|
||||
**surround**
|
||||
|
||||
**replace** => substr_replace
|
||||
|
||||
**insert**
|
||||
|
||||
**truncate**
|
||||
|
||||
**prune**
|
||||
|
Reference in New Issue
Block a user