Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.