StringPrototype.localeCompare(Object, Object) 方法

定義

比較兩個指定的字串,並且傳回表示這兩個字串語彙關係的整數。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public:
 static int localeCompare(System::Object ^ thisob, System::Object ^ thatob);
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.String_localeCompare)]
public static int localeCompare (object thisob, object thatob);
[<Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.String_localeCompare)>]
static member localeCompare : obj * obj -> int
Public Shared Function localeCompare (thisob As Object, thatob As Object) As Integer

參數

thisob
Object

這個方法執行位置的物件。

thatob
Object

要與 thisob 比較的字串。

傳回

thisob 小於 thatob 則為負值,當 thisob 等於 thatob 則為零,當 thisob 大於 thatob 則為正值。

屬性

適用於

另請參閱