javascript tutorial - [Solved-5 Solutions] Convert JavaScript String to lower case - javascript - java script - javascript array
Problem:
How to Convert JavaScript String to lower case ?
Solution 1:
Solution 2:
Use either toLowerCase or toLocaleLowerCase methods of the String object. The difference is that toLocaleLowerCase will take current locale of the user/host into account. As per § 15.5.4.17 of the ECMAScript Language Specification (ECMA-262) , toLocaleLowerCase… …works exactly the same as toLowerCase except that its result is intended to yield the correct result for the host environment’s current locale, rather than a locale-independent result. There will only be a difference in the few cases (such as Turkish) where the rules for that language conflict with the regular Unicode case mappings. Example:
Solution 3:
Solution 4:
Solution 5:
consuming a plugin, and was confused why I was getting a "extension.tolowercase is not a function" JS error.
Which produced the error "extension.toLowerCase is not a function" So we tried this piece of code, which revealed the problem!