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

◆ Parse() [5/13]

static ushort System.UInt16.Parse ( ReadOnlySpan< char > s,
NumberStyles style,
NumberFormatInfo info )
inlinestaticprivate

Definition at line 145 of file UInt16.cs.

146 {
147 uint result;
148 Number.ParsingStatus parsingStatus = Number.TryParseUInt32(s, style, info, out result);
149 if (parsingStatus != 0)
150 {
151 Number.ThrowOverflowOrFormatException(parsingStatus, TypeCode.UInt16);
152 }
153 if (result > 65535)
154 {
155 Number.ThrowOverflowException(TypeCode.UInt16);
156 }
157 return (ushort)result;
158 }

References System.info, System.s, System.Number.ThrowOverflowException(), System.Number.ThrowOverflowOrFormatException(), and System.Number.TryParseUInt32().