find-same-parts

1.0.3 • Public • Published

find-same-parts

build status Coverage Status

Find the same parts from two given strings

Install

$ npm install find-same-parts --save

Usage

findSameParts(firstString, secondString, options);
// will return the sames part in array
// options
// * minStrLength {INT}, set the minimum length of same parts
// * ignoreCase {Boolean}

e.g.

var findSameParts = require('find-same-parts');
 
findSameParts('hello world', 'Hello world'); //  ['hello world']
findSameParts('hello world', 'Hello world', {ignoreCase: false});  //  ['ello world']
 
findSameParts('hello world, bot', 'hello somebody, bot'); // ['hello', 'bot']
findSameParts('hello world, bot', 'hello somebody, bot', {minStrLength: 4}); ['hello']

Package Sidebar

Install

npm i find-same-parts

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

17.3 kB

Total Files

7

Last publish

Collaborators

  • ezmo