programming-examples/js/String/Test case insensitive (except special Unicode characters) string comparison.js
2019-11-15 12:59:38 +01:00

8 lines
231 B
JavaScript

function compare_strings(str1, str2)
{
var areEqual = str1.toUpperCase() === str2.toUpperCase();
return areEqual;
}
console.log(compare_strings('abcd', 'AbcD'));
console.log(compare_strings('ABCD', 'Abce'));