This topic has not yet been rated - Rate this topic

localeCompare Method

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

function localeCompare(stringExp : String) : Number
stringExp

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)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.