2 Example(s) of JavaScript toLocaleUpperCase function


Description :

JavaScript toLocaleUpperCase() function is used to convert string to upper case letters. See the code snippet:


JavaScript toLocaleUpperCase function Example - 1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to LearnKode - A code learning platform</title>
</head>
<body>
 <script>
         var str = "i love learnkode.";
         document.write(str.toLocaleUpperCase( ));
      </script>

</body>
</html>

Output

Description :

ToLocaleUpperCase javascript function will convert all the string to Upper case.


JavaScript toLocaleUpperCase function Example - 2
<!DOCTYPE html>
<html>
<head>
<title>Welcome to LearnKode - A code learning platform</title>
</head>
<body>
<script>
 var Str1 = "Learn JavaScript at LearnKode";
  var Str3 = Str1.toLocaleUpperCase();
 var Str4 = "Hi, This is FROM JS".toLocaleUpperCase();
 var Str5 = "JAVASCRIPT LOWERCASE".toLocaleUpperCase();
 
 document.write("<b> Str3  is converted to uppercase :</b> " + Str3);
 document.write("<br \> <b> Str4 : </b> " + Str4);
 document.write("<br \> <b> Str5 : </b> " + Str5);
</script>

</body>
</html>

Output