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

◆ ToUInt16() [16/19]

static ushort System.Convert.ToUInt16 ( string? value,
int fromBase )
inlinestatic

Definition at line 2567 of file Convert.cs.

2568 {
2569 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
2570 {
2571 throw new ArgumentException(SR.Arg_InvalidBase);
2572 }
2573 if (value == null)
2574 {
2575 return 0;
2576 }
2577 int num = ParseNumbers.StringToInt(value.AsSpan(), fromBase, 4608);
2578 if ((uint)num > 65535u)
2579 {
2581 }
2582 return (ushort)num;
2583 }
static void ThrowUInt16OverflowException()
Definition Convert.cs:479

References System.SR.Arg_InvalidBase, System.ParseNumbers.StringToInt(), System.Convert.ThrowUInt16OverflowException(), and System.value.