mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-09-02 01:22:37 +02:00
Added longestCommonSubstring
This commit is contained in:
17
README.md
17
README.md
@@ -37,6 +37,7 @@ Note: The methods listed below are subject to change until we reach a 1.0.0 rele
|
||||
* [shuffle](#shuffle)
|
||||
* [longestCommonPrefix](#longestcommonprefix)
|
||||
* [longestCommonSuffix](#longestcommonsuffix)
|
||||
* [longestCommonSubstring](#longestcommonsubstring)
|
||||
* [Tests](#tests)
|
||||
* [License](#license)
|
||||
|
||||
@@ -543,9 +544,21 @@ S::create('fòô bàř', 'UTF-8')->longestCommonSuffix('fòr bàř');
|
||||
S::longestCommonSuffix('fòô bàř', 'fòr bàř', 'UTF-8'); // ' bàř'
|
||||
```
|
||||
|
||||
## TODO
|
||||
##### longestCommonSubstring
|
||||
|
||||
**longestCommonSubstring**
|
||||
$stringy->longestCommonSubstring(string $otherString)
|
||||
|
||||
S::longestCommonSubstring(string $str, string $otherString [, $encoding ])
|
||||
|
||||
Finds the longest common substring between $str and $otherString. In the
|
||||
case of ties, returns that which occurs first.
|
||||
|
||||
```php
|
||||
S::create('foo bar')->longestCommonSubstring('boo far');
|
||||
S::longestCommonSubstring('foo bar', 'boo far'); // 'oo '
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
**count** => substr_count
|
||||
|
||||
|
Reference in New Issue
Block a user