- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 60字
- 2021-07-02 15:29:16
Comparing values using the CompareTo method
Now, let's do one more method. This one will be a little more sophisticated. It will be called Compare, and it will operate on different data types. So, enter the following beneath the closed curly brace at the end of the preceding lines:
public static string Compare<T>(T x, T y) where T : IComparable
推薦閱讀