JavaScript toLocaleUpperCase() Method
Example
Converts a string to uppercase:
var
str
=
"
Runoob
"
;
var
res
=
str
.
toLocaleUpperCase
(
)
;
n Output result:
RUNOOB
Try it »
Definition and Usage
The toLocaleUpperCase() method converts a string to uppercase according to the locale of the host environment.
The locale is determined by the browser's language settings.
Usually, this method returns the same result as toUpperCase() the method, except that a few languages (such as Turkish) have locale-specific case mappings.
Note: The toLocaleUpperCase() method does not change the original string.
Tip: Use toLocaleLowerCase() The method converts a string to lowercase according to the host environment's locale.
Browser support
The numbers in the table indicate the first browser version that supports this property.
| Method | |||||
|---|---|---|---|---|---|
| toLocaleLowerCase() | Yes | Yes | Yes | Yes | Yes |
Syntax
string.toLocaleUpperCase()
Parameter value
none.
Return Value
| Type | Description |
|---|---|
| String |
Converts to uppercase according to the local language. |
Technical Details
| JavaScript version: | ECMAScript 1 |
|---|
JavaScript String object