Converts a String to an Int16.
[Visual Basic] Overloads Public Shared Function Parse( _ ByVal s As String _ ) As Short [C#] public static short Parse( string s ); [C++] public: static short Parse( String* s ); [JScript] public static function Parse( s : String ) : Int16;
An Int16 with the value represented by s.
Exception Type | Condition |
---|---|
ArgumentNullException | If the string is a null reference (in Visual Basic Nothing). |
FormatException | If the string does not match the following regular expression: [0-9]. |
OverflowException | If the string represents a number that is less than MinValue or greater than MaxValue. |
The Parse method converts a String to an Int16. The string must consist of an optional minus sign ("-") followed by a sequence of digits ("0"- "9").
Leading and trailing white space characters are ignored.
Note Hexadecimal strings ("0x42") are not supported. Use Value or Convert ToIntxx(string, int) and ToUIntxx methods for the conversions.
Note The Parse method does not accept not a number (NaN) or positive or negative infinity.
Int16 Structure | Int16 Members | System Namespace | Int16.Parse Overload List | String | Value | Convert | NaN | NaN | PositiveInfinity | PositiveInfinity | NegativeInfinity | NegativeInfinity