July 1998
Intermediate to advanced
1456 pages
65h 5m
English
toLowerCase(), toUpperCase() — NN 2 IE J1 ECMA 1
Returns a copy of the current string in all lowercase or uppercase letters. If you want to replace the current string with a case-adjusted version, assign the result of the method to the same string:
myString = myString.toUpperCase()
It is common to use either one of these methods to create a case-insensitive comparison of two strings. This is especially convenient if one of the strings being compared is entered by a user, who may submit a variety of case situations:
if (document.forms[0].entry.value.toLowerCase() == compareValue) {
...
}String.
None.
Read now
Unlock full access