Method SafeCompareTo
SafeCompareTo(object, object)
Same as CompareTo(object) but additionally allows to compare different integer types without exceptions. Objects must support IComparable interface.
public static int SafeCompareTo(object a, object b)
Parameters
Returns
- int
A value that indicates the relative order of the objects being compared. Meanings: Result is less than zero –
a
precedesb
in the sort order. Result is zero –a
occurs in the same position in the sort order asb
. Result is greater than zero –a
followsb
in the sort order.