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

◆ Equals()

static bool System.MemoryExtensions.Equals ( this ReadOnlySpan< char > span,
ReadOnlySpan< char > other,
StringComparison comparisonType )
inlinestatic

Definition at line 1369 of file MemoryExtensions.cs.

1370 {
1371 string.CheckStringComparison(comparisonType);
1372 switch (comparisonType)
1373 {
1374 case StringComparison.CurrentCulture:
1375 case StringComparison.CurrentCultureIgnoreCase:
1376 return CultureInfo.CurrentCulture.CompareInfo.Compare(span, other, string.GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
1377 case StringComparison.InvariantCulture:
1378 case StringComparison.InvariantCultureIgnoreCase:
1379 return CompareInfo.Invariant.Compare(span, other, string.GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
1380 case StringComparison.Ordinal:
1381 return span.EqualsOrdinal(other);
1382 default:
1383 return span.EqualsOrdinalIgnoreCase(other);
1384 }
1385 }
static readonly CompareInfo Invariant
static CultureInfo CurrentCulture

References System.comparisonType, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.CompareInfo.Invariant, and System.other.

Referenced by System.Runtime.Versioning.FrameworkName.FrameworkName(), System.Diagnostics.DiagnosticSourceEventSource.FilterAndTransform.AddNewActivitySourceTransform(), System.Type.FilterNameImpl(), System.Diagnostics.NtProcessManager.GetProcessInfos(), System.Diagnostics.NtProcessInfoHelper.GetProcessShortName(), System.Diagnostics.ProcessManager.IsRemoteMachineCore(), System.IO.Directory.Move(), System.IO.PathHelper.Normalize(), and System.IO.PathHelper.TryExpandShortFileName().