Compare String by converting strings to its uppercase form in JavaScript

Description

The following code shows how to compare String by converting strings to its uppercase form.

Example


<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
<!--from w  w w .jav a 2  s.  com-->
var firstString = new String("AAA");
var secondString = new String("aaA");

var firstUpperString = firstString.toUpperCase();
var secondUpperString = secondString.toUpperCase();
document.write((firstUpperString==secondUpperString));
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Compare String by converting strings to its uppercase form in JavaScript
Home »
  Javascript Tutorial »
    Data Type »
      String
...
Access an individual character with bracket...
Add a new method to String class in JavaScr...
Append more than two strings in JavaScript
Capitalize the words in TextArea in JavaScr...
Check the return result from String.localeC...
Compare String by converting strings to its...
Compare a char value in if statement in Jav...
Compare a string based on locale informatio...
Compare the char value in JavaScript
Compare two strings in JavaScript
Concatenate one or more strings to another ...
Convert Number to String with toString meth...
Convert boolean to String in JavaScript
Convert boolean to string with String() in ...
Convert null to string with String() in Jav...
Convert number to string in radix in JavaSc...
Convert number to string with String() in J...
Convert string to lower case based on local...
Convert string to lower case with toLowerCa...
Convert string to upper case based on local...
Convert string to upper case in JavaScript
Convert undefined to string with String() i...
Convert value to String with toString metho...
Count the words in JavaScript
Create String from null in JavaScript
Create String object by calling its constru...
Demonstrate that all negative numbers are c...
Divide string into several parts with Strin...
Escape a string with escape function in Jav...
Find all occurrences for the sub string wit...
Get sub string with String substr() method ...
Get sub string with string substring method...
Get substring from the end of a string in J...
Get substring from the end with string subs...
Get substring with String slice() method in...
Get the character in the given position for...
Get the character's character code at the g...
Get the length of a string in JavaScript
...