A requirement is a numeric value entered in multiple input boxes, continuously entering a specified number of character text,
cannot be duplicated in other inputs, so a matching state is returned using fuzzy matching,
Look at the following code in detail:
/** Three company name Fuzzy match * @param Strarr needs to match the string array * @param len needs to match the minimum consecutive character length*/functionComnamecompare (strarr,len) {varresult = '; if(Strarr.length = = 3) {//requirements are three input boxes must be filled, the following is the fuzzy matching method for(vari = 0;i< strarr.length; i++ ){ for(varj = 0;j< Strarr[i].length-len; J + + ){ varstr = Strarr[i].slice (j,j+Len); varTemparr = Strarr.slice (0);//array does not change a single copy of the original dataTemparr.splice (i,1); for(vark = 0; k< temparr.length; k++ ){ varIsIn =temparr[k].indexof (str); if(IsIn >-1) {result= "Repeat"; returnresult; }Else{result= "Through"; returnresult; } } } } returnresult; }Else{alert ("Companies that need to fill in three comparisons!" "); }}
"Fuzzy Match" for the specified number of consecutive character strings in the array