alias
String.equalsIgnoreCase() (Java)
alias lang_id
java
how to
check if two strings are equal without case sensitivity
lang_id
js
qid
11001

How to
String.equalsIgnoreCase() (Java) in JavaScript

Redirected to “check if two strings are equal without case sensitivity

Convert the strings to lower case, and compare them.

s1 = "abcd";
s2 = "ABCD";
s3 = "a";

alert(s1.toLowerCase() == s2.toLowerCase()); // true
alert(s1.toLowerCase() == s3.toLowerCase()); // false
Select default language: