C# IComparable interface The IComparable interface defines a generalized type-specific comparison method that a value type or class implements to order or sort its instances . The IComparable is implemented by types whose values can be ordered or sorted. The interface requires the CompareTo method to be implemented.
Read moreHow do I check if a string is greater than another C#?
The C# Compare() method is used to compare first string with second string lexicographically. It returns an integer value. If both strings are equal, it returns 0. If first string is greater than second string, it returns 1 else it returns -1 .
Read more