javascript String localeCompare( )

localeCompare( )NN 6 IE 5.5(Win) ECMA 3  

localeCompare(string2)

  

Returns a number indicating whether the current string sorts before, the same as, or after the parameter string, based on browser- and system-dependent string localization. If the current string sorts before the parameter string, the return value is a negative number; if they are the same, the return value is 0, if the current string sorts after the parameter string, the return value is a positive number.

 

Use this method with caution if the strings contain characters outside the Latin character set because each browser can determine what localization equalities are in place. They also calculate the return values differently.

 
Parameters
 
  • Any string.
 
Returned Value

Integer


1787,Nickname,Homepage or email,Comments here,Add comment