Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to compare strings in javascript ignoring case sensitive

const str1 = 'Bill@microsoft.com';
const str2 = 'bill@microsoft.com';

str1 === str2; // false
str1.toLowerCase() === str2.toLowerCase(); // true
Comment

case insensitive string comparison in JavaScript

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");
}
Comment

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' }); 
Comment

PREVIOUS NEXT
Code Example
Javascript :: leafletjs code 
Javascript :: rounding to two decimal places 
Javascript :: jsx full form 
Javascript :: cypress/react yarn 
Javascript :: js regex word before word 
Javascript :: graphql yoga access http headers 
Javascript :: react duration picker 
Javascript :: reportValidity 
Javascript :: javascript declare empty array 
Javascript :: dates in javascript 
Javascript :: javascript stack reverse 
Javascript :: graphql buildschema 
Javascript :: java.lang.IllegalArgumentException: Can only download HTTP/HTTPS 
Javascript :: tilt js vue 
Javascript :: assigned property delete in jquery 
Javascript :: socket-client-io for reconnection in js or javascript 
Javascript :: javascript Short and Long date format 
Javascript :: get search value from reacr route1 
Javascript :: react get css root variables 
Javascript :: js check if object key exists 
Javascript :: how to host a react website 
Javascript :: javascript sort two-dimensional array by column 
Javascript :: ajax error slider revolution 
Javascript :: jquery clone object 
Javascript :: notify jquery 
Javascript :: vscode format - .prettierrc jsx singleQuote not work 
Javascript :: react useeffect hooks 
Javascript :: react native comment in render 
Javascript :: ForEach Element with Function or Lambda 
Javascript :: addition of time in javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =