Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Compare() [1/4]

int System.StringComparer.Compare ( object? x,
object? y )
inline

Definition at line 104 of file StringComparer.cs.

105 {
106 if (x == y)
107 {
108 return 0;
109 }
110 if (x == null)
111 {
112 return -1;
113 }
114 if (y == null)
115 {
116 return 1;
117 }
118 if (x is string x2 && y is string y2)
119 {
120 return Compare(x2, y2);
121 }
122 if (x is IComparable comparable)
123 {
124 return comparable.CompareTo(y);
125 }
126 throw new ArgumentException(SR.Argument_ImplementIComparable);
127 }
int Compare(object? x, object? y)

References System.SR.Argument_ImplementIComparable, System.comparable, and System.StringComparer.Compare().

Referenced by System.StringComparer.Compare().