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

Add between

This commit is contained in:
Daniel St. Jules
2015-07-24 13:34:07 -07:00
parent 9d5a06cf37
commit 342ef7c3dd
3 changed files with 72 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
* [Instance methods](#instance-methods)
* [append](#appendstring-string)
* [at](#atint-index)
* [between](#betweenstring-start-string-end--int-offset)
* [camelize](#camelize)
* [chars](#chars)
* [collapseWhitespace](#collapsewhitespace)
@@ -229,6 +230,16 @@ Returns the character at $index, with indexes starting at 0.
S::create('fòô bàř')->at(6); // 'ř'
```
##### between(string $start, string $end [, int $offset])
Returns the substring between $start and $end, if found, or an empty
string. An optional offset may be supplied from which to begin the
search for the start string.
```php
S::create('{foo} and {bar}')->between('{', '}'); // 'foo'
```
##### camelize()
Returns a camelCase version of the string. Trims surrounding spaces,