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 :: ajax call with form data 
Javascript :: discord.js join voice channel 
Javascript :: how to get all items in localstorage 
Javascript :: eslint disable react 
Javascript :: how to use componentdidmount in functional component 
Javascript :: simple AES encryption javascript 
Javascript :: javascript onclick event listener 
Javascript :: how to replace word from string in javascript 
Javascript :: jquery loop through class inside the div 
Javascript :: change info pagination datatable 
Javascript :: typeof date javascript 
Javascript :: ^(?:(+|00)d{1,3}[-s.])?(()?d{3,10}())?(?:[-s.)]d{2,7}([-s.]d{2,5})?([-s.]d{2})?)?$ 
Javascript :: Twilio room does not disconnect / Webcam LED remains on 
Javascript :: how to push the get variables without page reloading in Jquery 
Javascript :: jquery if variable contains text 
Javascript :: regex to remove spaces 
Javascript :: remove sliding animation from owl carousel 
Javascript :: regex for ip address javascript 
Javascript :: circle button react native 
Javascript :: how to calculate average of array in javascript 
Javascript :: JavaScript does not protect the property name hasOwnProperty 
Javascript :: react-native-render-html link click 
Javascript :: javascript current date 
Javascript :: convert milliseconds to seconds js 
Javascript :: get the size of the screen javascript 
Javascript :: JS get number of classes in html 
Javascript :: Please delete and rebuild the package with Ivy partial compilation mode, before attempting to publish. 
Javascript :: javascript getmonth 
Javascript :: jquery get top position of element on scroll 
Javascript :: js get locale 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =