toLocaleString (String - JavaScript)

Gets the string representation of a String object taking into account the host locale.

Defined in

String (Standard - JavaScript)

Syntax

toLocaleString() : string
Return value Description
string The string representation of the object.

Examples

The following example gets a String object as a locale string.
cities = new String("Paris   Moscow   Tokyo");
cities.toLocaleString()