shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
extractSame
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string
This function return you what has been find the same in the two passed string. It will return you either an array of same string parts or a simple string representing the first same part found.
Params
- string1*-String
The string 1 to compare
- string2*-String
The string 2 to compare
- multiplefalseBoolean
Specify if you want to get back multiple same string if exists as an array
Return
- -String|Array
The same string part(s) found
Example
import { extractSame } from '@blackbyte/sugar/string';
extractSame('Hello world', 'Hello plop'); // => 'Hello 'Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space