Editar

Partilhar via


Array.IStructuralComparable.CompareTo(Object, IComparer) Method

Definition

Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order.

 virtual int System.Collections.IStructuralComparable.CompareTo(System::Object ^ other, System::Collections::IComparer ^ comparer) = System::Collections::IStructuralComparable::CompareTo;
int IStructuralComparable.CompareTo (object other, System.Collections.IComparer comparer);
abstract member System.Collections.IStructuralComparable.CompareTo : obj * System.Collections.IComparer -> int
override this.System.Collections.IStructuralComparable.CompareTo : obj * System.Collections.IComparer -> int
Function CompareTo (other As Object, comparer As IComparer) As Integer Implements IStructuralComparable.CompareTo

Parameters

other
Object

The object to compare with the current instance.

comparer
IComparer

An object that compares the current object and other.

Returns

An integer that indicates the relationship of the current collection object to other, as shown in the following table.

Return value Description
-1 The current instance precedes other.
0 The current instance and other are equal.
1 The current instance follows other.

Implements

Remarks

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

Applies to