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

◆ LastIndexOf() [2/15]

unsafe int System.Globalization.CompareInfo.LastIndexOf ( ReadOnlySpan< char > source,
ReadOnlySpan< char > value,
CompareOptions options = CompareOptions::None )
inline

Definition at line 936 of file CompareInfo.cs.

937 {
938 if ((options & ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth)) == 0)
939 {
940 if (!GlobalizationMode.Invariant)
941 {
942 if (value.IsEmpty)
943 {
944 return source.Length;
945 }
947 }
948 if ((options & CompareOptions.IgnoreCase) == 0)
949 {
950 return source.LastIndexOf(value);
951 }
952 return Ordinal.LastIndexOfOrdinalIgnoreCase(source, value);
953 }
954 return options switch
955 {
956 CompareOptions.Ordinal => source.LastIndexOf(value),
957 CompareOptions.OrdinalIgnoreCase => Ordinal.LastIndexOfOrdinalIgnoreCase(source, value),
958 _ => throw new ArgumentException(SR.Argument_InvalidFlag, "options"),
959 };
960 }
unsafe int IndexOfCore(ReadOnlySpan< char > source, ReadOnlySpan< char > target, CompareOptions options, int *matchLengthPtr, bool fromBeginning)

References System.SR.Argument_InvalidFlag, System.Runtime.Serialization.Dictionary, System.Globalization.CompareInfo.IndexOfCore(), System.Globalization.GlobalizationMode.Invariant, System.Globalization.Ordinal.LastIndexOfOrdinalIgnoreCase(), System.options, System.source, and System.value.