CompareTo
This method compares the current OracleString
instance to the supplied object, and returns an integer that represents their relative values.
Declaration
// C# public int CompareTo(object obj);
Parameters
-
obj
The object being compared to the current instance.
Return Value
The method returns a number that is:
-
Less than zero: if the current
OracleString
value is less thanobj
. -
Zero: if the current
OracleString
value is equal toobj
. -
Greater than zero: if the current
OracleString
value is greater thanobj
.
Implements
IComparable
Exceptions
ArgumentException
- The obj
parameter is not of type OracleString
.
Remarks
The following rules apply to the behavior of this method.
-
The comparison must be between
OracleString
s. For example, comparing anOracleString
instance with anOracleBinary
instance is not allowed. When anOracleString
is compared with a different type, anArgumentException
is thrown. -
Any
OracleString
that has a value is greater than anOracleString
that has a null value. -
Two
OracleString
s that contain a null value are equal.