const str1 = 'Bill@microsoft.com';
const str2 = 'bill@microsoft.com';
str1 === str2; // false
str1.toLowerCase() === str2.toLowerCase(); // true
let dummyString1 = "rock";
let dummyString2 = "Rock";
let pattern = new RegExp('^' + dummyString2 + '$', 'i');
if (pattern.test(dummyString1)) {
console.log("String Matched");
} else {
console.log("String Not Matched");
}
const str1 = 'Bill@microsoft.com';
const str2 = 'bill@microsoft.com';
str1 === str2; // false
// will return 0, means these two strings are equal according to `localeCompare()`
str1.localeCompare(str2, undefined, { sensitivity: 'accent' });