NullableTypes Class Library

NullableString.CompareTo Method (Object)

Compares this NullableString structure to a specified object and returns an indication of their relative values.

[Visual Basic]
NotOverridable Overloads Public Function CompareTo( _
   ByVal value As Object _
) As Integer Implements _
public int CompareTo(
   object value


An object to compare, or a null reference (Nothing in Visual Basic).

Return Value

A signed number indicating the relative values of the instance and value.

A negative integer This instance is less than value.
Zero This instance is equal to value.
A positive integer This instance is greater than value.


value is a null reference (Nothing in Visual Basic) or Null.




Any instance of NullableString including the Empty string, regardless of its value, is considered greater than a null reference (Nothing in Visual Basic) and Null; and two Null compare equal to each other.


Exception TypeCondition
ArgumentException The value is neither null or of type NullableInt32.

See Also

NullableString Class | NullableTypes Namespace | NullableString.CompareTo Overload List