[To be supplied.]
[Visual Basic] Overloads Public Shared Function Parse( _ ByVal s As String, _ ByVal style As NumberStyles, _ ByVal info As NumberFormatInfo _ ) As Short [C#] public static short Parse( string s, NumberStyles style, NumberFormatInfo info ); [C++] public: static short Parse( String* s, NumberStyles style, NumberFormatInfo* info ); [JScript] public static function Parse( s : String, style : NumberStyles, info : NumberFormatInfo ) : Int16;
An Int16 with the value represented by the string.
Exception Type | Condition |
---|---|
ArgumentNullException | If the string is a null reference (in Visual Basic Nothing). |
ArgumentException | If the style is not a NumberStyles enumeration. |
FormatException | If the string is not of the correct format. |
OverflowException | If the string represents a number that is less than MinValue or greater than MaxValue. |
The Parse method converts a string to a numeric value. The default (culture neutral) NumberFormatInfo is used. The output from ToString is consumable by FromString. Use Parse() and Format() for culture dependent strings.
If the s parameter has been created by one of the Format methods using C, D, E, F, G, or N as the format specifier, it is guaranteed that s can be parsed when style is NumberStyles.
The style parameter must be a combination of bit flags from the NumberStyles enumeration.
If the info parameter is a null reference (Nothing), the numeric format information is obtained from the current locale (see NumberFormatInfo and CultureInfo for specific information for numeric and culture formats).
Note Hexadecimal strings ("0x42") are not supported. Use the Convert ToIntxx(string, int) and ToUIntxx methods for the conversions.
Note The Parse methods do 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