UIntPtr.CompareTo Method

Definition

Overloads

CompareTo(Object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

CompareTo(UIntPtr)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

CompareTo(Object)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

C#
public int CompareTo(object? value);

Parameters

value
Object

An object to compare, or null.

Returns

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes value in the sort order.
Zero This instance occurs in the same position in the sort order as value.
Greater than zero This instance follows value in the sort order.

Implements

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10

CompareTo(UIntPtr)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

C#
public int CompareTo(UIntPtr value);

Parameters

value
UIntPtr

An unsigned native integer to compare.

Returns

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes value in the sort order.
Zero This instance occurs in the same position in the sort order as value.
Greater than zero This instance follows value in the sort order.

Implements

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10