CodesJava

Easy learning with example program codes

toLocaleUpperCase() String JavaScript JS

The JavaScript string toLocaleUpperCase() method transforms the given string into uppercase letter on the basis of current locale of the host.

Note: A string can be converted into upper case letters with toUpperCase() method but result may vary according to locale or language. To overcome this problem we have to use toLocaleUpperCase().

Syntax:

string.toLocaleUpperCase() 

Return:
Locale specific string with upper case letters.

Example:

<!DOCTYPE html>
<html>
<body>
<script>   
var a ="Hello World!";  
document.write(a.toLocaleUpperCase());  
</script>
</body>
</html>

Output:

HELLO WORLD!
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status