JavaScript String toLocaleUpperCase() Method

The toLocaleUpperCase function in JavaScript transforms a string into uppercase according to the host's locale settings. In general, this function produces the same outcome as using the regular toUpperCase method.

Syntax

The syntax for the toLocaleUpperCase method is as follows:

Example

string. toLocaleUpperCase()

Returns

A sequence of capital letters according to the host's current locale.

JavaScript String toLocaleUpperCase Method Example

Let's explore some basic illustrations of the toLocaleUpperCase function.

Example 1

In this section, we will demonstrate how to convert a provided string to uppercase letters.

Example

<script>

var str="Example";

document.writeln(str.toLocaleUpperCase());

</script>

Output:

Output

Example

Example 2

Let's examine another illustration of how to display a provided string in uppercase format.

Example

<script>

var str=new String("Example");

document.writeln(str.toLocaleUpperCase());

</script>

Output:

Output

Example

Input Required

This code uses input(). Please provide values below: