mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-09-02 01:22:37 +02:00
Added lines
This commit is contained in:
10
README.md
10
README.md
@@ -51,6 +51,7 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
|
||||
* [isUpperCase](#isuppercase)
|
||||
* [last](#last)
|
||||
* [length](#length)
|
||||
* [lines](#lines)
|
||||
* [longestCommonPrefix](#longestcommonprefixstring-otherstr)
|
||||
* [longestCommonSuffix](#longestcommonsuffixstring-otherstr)
|
||||
* [longestCommonSubstring](#longestcommonsubstringstring-otherstr)
|
||||
@@ -525,6 +526,15 @@ Returns the length of the string. An alias for PHP's mb_strlen() function.
|
||||
s('fòô bàř')->length(); // 7
|
||||
```
|
||||
|
||||
##### lines()
|
||||
|
||||
Splits on newlines and carriage returns, returning an array of Stringy
|
||||
objects corresponding to the lines in the string.
|
||||
|
||||
```php
|
||||
s("fòô\r\nbàř\n")->lines(); // ['fòô', 'bàř', '']
|
||||
```
|
||||
|
||||
##### longestCommonPrefix(string $otherStr)
|
||||
|
||||
Returns the longest common prefix between the string and $otherStr.
|
||||
|
Reference in New Issue
Block a user