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

Style fixes

This commit is contained in:
Daniel St. Jules
2015-06-29 15:33:00 -07:00
parent 2c295fd15d
commit 397d2ca2f8
3 changed files with 60 additions and 52 deletions

View File

@@ -479,30 +479,32 @@ S::humanize('author_id'); // 'Author'
#### indexOf
$stringy->indexOf(string $substr [, $offset = 0 ]);
$stringy->indexOf(string $needle [, $offset = 0 ]);
S::indexOf(string $str , string $substr [, $offset = 0 [, $encoding = null ]])
S::indexOf(string $haystack , string $needle [, $offset = 0 [, $encoding = null ]])
Returns the offset/index of the first occurrence of $substr in the string.
In case $substr is not a substring of the string, returns false.
Returns the index of the first occurrence of $needle in the string,
and false if not found. Accepts an optional offset from which to begin
the search.
```php
S::create('string', 'UTF-8')->indexOf('ing');
S::indexOf('string', 'ing', 0, 'UTF-8'); // 3
S::indexOf('string', 'ing'); // 3
```
#### indexOfLast
$stringy->indexOfLast(string $substr [, $offset = 0 ]);
$stringy->indexOfLast(string $needle [, $offset = 0 ]);
S::indexOfLast(string $str , string $substr [, $offset = 0 [, $encoding = null ]])
S::indexOfLast(string $haystack , string $needle [, $offset = 0 [, $encoding = null ]])
Returns the offset/index of the last occurrence of $substr in the string.
In case $substr is not a substring of the string, returns false.
Returns the index of the last occurrence of $needle in the string,
and false if not found. Accepts an optional offset from which to begin
the search.
```php
S::create('string', 'UTF-8')->indexOfLast('ing');
S::indexOfLast('string string', 'ing', 0, 'UTF-8'); // 10
S::indexOfLast('string string', 'ing'); // 10
```
#### insert
@@ -1054,7 +1056,7 @@ $stringy->trim()
S::trim(string $str)
Returns the trimmed string. An alias for PHP's trim() function.
Returns the trimmed string.
```php
S::create('fòô bàř', 'UTF-8')->trim();