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

◆ CompareOrdinal() [2/3]

static int System.String.CompareOrdinal ( string? strA,
int indexA,
string? strB,
int indexB,
int length )
inlinestatic

Definition at line 393 of file String.cs.

394 {
395 if ((object)strA == null || (object)strB == null)
396 {
397 if ((object)strA == strB)
398 {
399 return 0;
400 }
401 if ((object)strA != null)
402 {
403 return 1;
404 }
405 return -1;
406 }
407 if (length < 0)
408 {
409 throw new ArgumentOutOfRangeException("length", SR.ArgumentOutOfRange_NegativeCount);
410 }
411 if (indexA < 0 || indexB < 0)
412 {
413 string paramName = ((indexA < 0) ? "indexA" : "indexB");
414 throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index);
415 }
416 int num = Math.Min(length, strA.Length - indexA);
417 int num2 = Math.Min(length, strB.Length - indexB);
418 if (num < 0 || num2 < 0)
419 {
420 string paramName2 = ((num < 0) ? "indexA" : "indexB");
421 throw new ArgumentOutOfRangeException(paramName2, SR.ArgumentOutOfRange_Index);
422 }
423 if (length == 0 || ((object)strA == strB && indexA == indexB))
424 {
425 return 0;
426 }
428 }
static int CompareOrdinalHelper(string strA, int indexA, int countA, string strB, int indexB, int countB)
Definition String.cs:116

References System.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_NegativeCount, System.String.CompareOrdinalHelper(), System.length, and System.Math.Min().