We have a string comparison like below.
value1 = "?????? ??? {er}"
value2 = "?????????? errr"
I have to check value 2 is same like value1 except for the err part.
var separators = ['{er}','{Er}','{ER}','{#eR#}'];
let dMsg = value1.split(new RegExp(separators.join('|'),'g'));
let msg = true;
for (var m = 0; m < dMsg.length; m++) {
if (!value1.includes(dMsg[m])) {
Status = "Fail"
break;
}
}
Even though both strings are same, Im getting status as failure. Can anybody help me where I'm going wrong?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…