JavaScript String toLocaleUpperCase() method

Definition and usage

toLocaleUpperCase() The method uses the current language environment to convert the string to uppercase letters.

The current language environment is based on the browser's language settings.

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

toLocaleUpperCase() Returns with toUpperCase() The same result, except for language environments that conflict with the conventional Unicode case mapping (such as Turkish).

See also:

toUpperCase() method

toLowerCase() method

toLocaleLowerCase() method

Example

Convert to uppercase:

let text = "Hello World!";
let result = text.toLocaleUpperCase();

Try it yourself

Syntax

string.toLocaleUpperCase()

Parameter

No parameters.

Return value

Type Description
String. Convert to uppercase new string based on the current language environment.

Note:The return value of this method is string A copy of it, converted to lowercase letters in the local way. Only a few languages (such as Turkish) have locale-specific case mappings, so the return value of this method is usually the same as toUpperCase() The same.

Browser support

toLocalUpperCase() Is ECMAScript1 (ES1) feature.

All browsers fully support ES1 (JavaScript 1997):

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support

Related pages

JavaScript String

JavaScript String Methods

JavaScript String Search