StringComparer.IComparer.Compare(Object, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
比較兩個物件,並回傳一個值,表示其中一個小於、等於或大於另一個。
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
第二個比較物件。
傳回
一個帶符號的整數,表示 和 x的y相對值。
實作
備註
此成員為明確介面成員實作。 它只能在實 StringComparer 例投射到 IComparer 介面時使用。
回報值具有以下含義:
| 價值觀 | Meaning |
|---|---|
| 低於零 |
x 小於 y。 |
| 零 |
x 等於 y. |
| 大於零 |
x 大於 y。 |