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

◆ IndexOfAny() [3/3]

int System.String.IndexOfAny ( char[] anyOf,
int startIndex,
int count )
inline

Definition at line 3285 of file String.cs.

3286 {
3287 if (anyOf == null)
3288 {
3289 throw new ArgumentNullException("anyOf");
3290 }
3291 if ((uint)startIndex > (uint)Length)
3292 {
3293 throw new ArgumentOutOfRangeException("startIndex", SR.ArgumentOutOfRange_Index);
3294 }
3295 if ((uint)count > (uint)(Length - startIndex))
3296 {
3297 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_Count);
3298 }
3299 if (anyOf.Length != 0 && anyOf.Length <= 5)
3300 {
3301 int num = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startIndex), count).IndexOfAny(anyOf);
3302 if (num != -1)
3303 {
3304 return num + startIndex;
3305 }
3306 return num;
3307 }
3308 if (anyOf.Length > 5)
3309 {
3311 }
3312 return -1;
3313 }
char _firstChar
Definition String.cs:35
unsafe int IndexOfCharArray(char[] anyOf, int startIndex, int count)
Definition String.cs:3315

References System.String._firstChar, System.SR.ArgumentOutOfRange_Count, System.SR.ArgumentOutOfRange_Index, System.count, System.String.IndexOfCharArray(), System.String.Length, and System.startIndex.