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

◆ Parse() [5/13]

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

Definition at line 148 of file SByte.cs.

149 {
150 int result;
151 Number.ParsingStatus parsingStatus = Number.TryParseInt32(s, style, info, out result);
152 if (parsingStatus != 0)
153 {
154 Number.ThrowOverflowOrFormatException(parsingStatus, TypeCode.SByte);
155 }
156 if ((uint)(result - -128 - ((int)(style & NumberStyles.AllowHexSpecifier) >> 2)) > 255u)
157 {
158 Number.ThrowOverflowException(TypeCode.SByte);
159 }
160 return (sbyte)result;
161 }

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