Bagikan melalui


Array.IStructuralComparable.CompareTo Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Private Function CompareTo ( _
    other As Object, _
    comparer As IComparer _
) As Integer Implements IStructuralComparable.CompareTo
int IStructuralComparable.CompareTo(
    Object other,
    IComparer comparer
)

Parameters

  • other
    Type: System.Object
    The object to compare with the current instance.

Return Value

Type: System.Int32
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

IStructuralComparable.CompareTo(Object, IComparer)

Remarks

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

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference