語言

StringComparer.IComparer.Compare(Object, Object) 方法

定義

比較兩個物件,並回傳一個值,表示其中一個小於、等於或大於另一個。

 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

參數

x
Object

第一個比較的對象。

y
Object

第二個比較物件。

傳回

一個帶符號的整數,表示 和 xy相對值。

實作

備註

此成員為明確介面成員實作。 它只能在實 StringComparer 例投射到 IComparer 介面時使用。

回報值具有以下含義:

價值觀 Meaning
低於零 x 小於 y
x 等於 y.
大於零 x 大於 y

適用於