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

◆ IndexOf()

static int System.Globalization.Ordinal.IndexOf ( string source,
string value,
int startIndex,
int count,
bool ignoreCase )
inlinestaticpackage

Definition at line 122 of file Ordinal.cs.

123 {
124 if (source == null)
125 {
126 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
127 }
128 if (value == null)
129 {
130 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
131 }
132 if (!source.TryGetSpan(startIndex, count, out var slice))
133 {
134 if ((uint)startIndex > (uint)source.Length)
135 {
136 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_Index);
137 }
138 else
139 {
140 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_Count);
141 }
142 }
143 int num = (ignoreCase ? IndexOfOrdinalIgnoreCase(slice, value) : slice.IndexOf(value));
144 if (num < 0)
145 {
146 return num;
147 }
148 return num + startIndex;
149 }
static int IndexOf(string source, string value, int startIndex, int count, bool ignoreCase)
Definition Ordinal.cs:122
static int IndexOfOrdinalIgnoreCase(ReadOnlySpan< char > source, ReadOnlySpan< char > value)
Definition Ordinal.cs:151

References System.count, System.Globalization.Ordinal.IndexOfOrdinalIgnoreCase(), System.source, System.startIndex, System.ThrowHelper.ThrowArgumentNullException(), System.ThrowHelper.ThrowArgumentOutOfRangeException(), and System.value.

Referenced by System.String.IndexOf().