+ 8

How to compare two text value?

two span text value, campare and find, wrong, extra and skipped word in 2nd span text, 1 span original text and 2nd span text is modified duplicate copy of first. for eg: x= "This is a original text string" y="this is a not original string" here : 'this' wrong word and 'text' is skipped and 'not' extra word in string. have any idea how to solve it?

28th Jun 2018, 5:20 AM
Lakhvir Singh
Lakhvir Singh - avatar
3 Respostas
+ 7
@Shudarshan Rai this case fail when any word is skipped or extra word interserted into 2nd text. then all next word count as wrong word.
28th Jun 2018, 7:33 AM
Lakhvir Singh
Lakhvir Singh - avatar
+ 4
var x= "This is a original text string"; var y="this is a not haveoriginal string"; if(x != y){ alert ("not matched with original strings"); }else{ alert ("matched"); }
28th Jun 2018, 5:25 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 3
above code comparea two variables x and y and using if equal or not, it send us a output
28th Jun 2018, 5:27 AM
Sudarshan Rai
Sudarshan Rai - avatar