Skip to content

chenjihu/findSameParts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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']

About

Get the same parts from two given strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published