1.1.0 • Published 6 years ago

string-difference v1.1.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
6 years ago

Basic usage. Basic scope. Easy to use.

Warning: Compared 2 string should be at the same length. It will say you which chars are different.

//Basic Usage
var stringDifference = require('string-difference');

var difference = new stringDifference().calculateDifference("string1", "string2");

console.log(difference); //Expected Output: [true, true, true, true, true, true, false]


//Finding the difference
var index = difference.indexOf(false);

console.log("string1".charAt(index)); //Expected Output: 1
console.log("string2".charAt(index)); //Expected Output: 2

//Difference: 1-2

A find the difference puzzle solver!