Share via


StringPrototype.localeCompare(Object, Object) Metode

Definisi

Membandingkan dua string yang ditentukan dan mengembalikan bilangan bulat yang menunjukkan hubungan leksikal di antaranya.

API ini mendukung infrastruktur produk dan tidak dimaksudkan untuk digunakan langsung dari kode Anda.

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

Parameter

thisob
Object

Objek yang ditindakkan oleh metode ini.

thatob
Object

String untuk dibandingkan dengan thisob.

Mengembalikan

Nilai negatif ketika kurang dari thatob; nol ketika thisob sama thatobdengan ; nilai positif ketika thisob lebih besar dari thatob.thisob

Atribut

Berlaku untuk

Lihat juga