String.localeCompare() (Method)

A locale sensitive string comparison.


ECMAScript edition - 3
JavaScript - 1.5
JScript - 5.5
Internet Explorer - 5.5
Netscape - 6.0
Property/method value type:Boolean primitive
JavaScript syntax:-myString.localeCompare(aString)
Argument list:aStringA string to compare the value of this object against

The string passed as an argument is compared with the primitive value of the receiving String object. Using simple character comparison techniques they may not match and would fail an A == B test. The locale sensitive comparison takes special international characters and locale specific text issues into account and properly matches the strings.


ECMA 262 edition 3 - section -