แก้ไข

แชร์ผ่าน


StringComparer.IComparer.Compare(Object, Object) Method

Definition

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

 virtual int System.Collections.IComparer.Compare(System::Object ^ x, System::Object ^ y) = System::Collections::IComparer::Compare;
int IComparer.Compare (object x, object y);
abstract member System.Collections.IComparer.Compare : obj * obj -> int
override this.System.Collections.IComparer.Compare : obj * obj -> int
Function Compare (x As Object, y As Object) As Integer Implements IComparer.Compare

Parameters

x
Object

The first object to compare.

y
Object

The second object to compare.

Returns

A signed integer that indicates the relative values of x and y.

Implements

Remarks

This member is an explicit interface member implementation. It can be used only when the StringComparer instance is cast to an IComparer interface.

The return value has these meanings:

Value Meaning
Less than zero x is less than y.
Zero x equals y.
Greater than zero x is greater than y.

Applies to