Javascript - String toLocaleUpperCase() Method

The toLocaleUpperCase() method converts a string to uppercase letters, according to the host's current locale.

Description

The toLocaleUpperCase() method converts a string to uppercase letters, according to the host's current locale.

The locale is based on the language settings of the browser.

This method returns the same result as the toUpperCase() method normally.

For some locales, such as Turkish, the results may vary.

The toLocaleUpperCase() method does not change the original string.

Syntax

string.toLocaleUpperCase()

Parameters

None

Return

A String, representing the value of a string converted to uppercase according to the host's current locale

Example

Convert the string to uppercase letters:

Demo

//convert the string to uppercase letters.
var str = "Hello World!";
var res = str.toLocaleUpperCase();
console.log(res);/*from   w  w w  . j a  v a  2 s  . c o m*/

Result