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

◆ LastIndexOf()

static int System.MemoryExtensions.LastIndexOf ( this ReadOnlySpan< char > span,
ReadOnlySpan< char > value,
StringComparison comparisonType )
inlinestatic

Definition at line 1455 of file MemoryExtensions.cs.

1456 {
1457 string.CheckStringComparison(comparisonType);
1458 switch (comparisonType)
1459 {
1460 case StringComparison.Ordinal:
1461 return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
1462 case StringComparison.CurrentCulture:
1463 case StringComparison.CurrentCultureIgnoreCase:
1464 return CultureInfo.CurrentCulture.CompareInfo.LastIndexOf(span, value, string.GetCaseCompareOfComparisonCulture(comparisonType));
1465 case StringComparison.InvariantCulture:
1466 case StringComparison.InvariantCultureIgnoreCase:
1467 return CompareInfo.Invariant.LastIndexOf(span, value, string.GetCaseCompareOfComparisonCulture(comparisonType));
1468 default:
1470 }
1471 }
static readonly CompareInfo Invariant
static CultureInfo CurrentCulture
static int LastIndexOfOrdinalIgnoreCase(ReadOnlySpan< char > source, ReadOnlySpan< char > value)
Definition Ordinal.cs:172

References System.comparisonType, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.CompareInfo.Invariant, System.SpanHelpers.LastIndexOf(), System.Globalization.Ordinal.LastIndexOfOrdinalIgnoreCase(), and System.value.