This documentation is archived and is not being maintained.

localeCompare Method 

Returns a value indicating whether two strings are equivalent in the current locale.

function localeCompare(stringExp : String) : Number


Required. String to compare against the current string object.

The localeCompare performs a locale-sensitive string comparison of the current string object and the stringExp and returns -1, 0, or +1, depending on the sort order of the system default locale.

If the current string object sorts before stringExp, localeCompare returns –1; if the current string sorts after stringExp, +1 is returned. A return value of zero means that the two strings are equivalent.