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

◆ LastIndexOf() [3/9]

int System.String.LastIndexOf ( char value,
int startIndex,
int count )
inline

Definition at line 3435 of file String.cs.

3436 {
3437 if (Length == 0)
3438 {
3439 return -1;
3440 }
3441 if ((uint)startIndex >= (uint)Length)
3442 {
3443 throw new ArgumentOutOfRangeException("startIndex", SR.ArgumentOutOfRange_Index);
3444 }
3445 if ((uint)count > (uint)(startIndex + 1))
3446 {
3447 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_Count);
3448 }
3449 int num = startIndex + 1 - count;
3450 int num2 = SpanHelpers.LastIndexOf(ref Unsafe.Add(ref _firstChar, num), value, count);
3451 if (num2 != -1)
3452 {
3453 return num2 + num;
3454 }
3455 return num2;
3456 }
char _firstChar
Definition String.cs:35

References System.String._firstChar, System.SR.ArgumentOutOfRange_Count, System.SR.ArgumentOutOfRange_Index, System.count, System.SpanHelpers.LastIndexOf(), System.String.Length, System.startIndex, and System.value.