Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript string insensitive compare

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' }); 
Source by masteringjs.io #
 
PREVIOUS NEXT
Tagged: #javascript #string #insensitive #compare
ADD COMMENT
Topic
Name
1+8 =