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

  1. string1*-String

    The string 1 to compare

  2. string2*-String

    The string 2 to compare

  3. multiplefalseBoolean

    Specify if you want to get back multiple same string if exists as an array

Return

  1. -String|Array

    The same string part(s) found

Example

import { extractSame } from '@blackbyte/sugar/string';
extractSame('Hello world', 'Hello plop'); // => 'Hello '

Todo

  • testsnormal