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 –
aprecedesbin the sort order. Result is zero –aoccurs in the same position in the sort order asb. Result is greater than zero –afollowsbin the sort order.