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

◆ AsSpan() [2/3]

static ReadOnlySpan< char > System.MemoryExtensions.AsSpan ( this string? text,
int start )
inlinestatic

Definition at line 377 of file MemoryExtensions.cs.

378 {
379 if (text == null)
380 {
381 if (start != 0)
382 {
383 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start);
384 }
385 return default(ReadOnlySpan<char>);
386 }
387 if ((uint)start > (uint)text.Length)
388 {
389 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start);
390 }
391 return new ReadOnlySpan<char>(ref Unsafe.Add(ref text.GetRawStringData(), (nint)(uint)start), text.Length - start);
392 }

References System.start, System.text, and System.ThrowHelper.ThrowArgumentOutOfRangeException().