Converts a string to a Double.
[Visual Basic] Overloads Public Shared Function Parse( _ ByVal s As String _ ) As Double [C#] public static double Parse( string s ); [C++] public: static double Parse( String* s ); [JScript] public static function Parse( s : String ) : double;
The Double whose value was specified by s.
Exception Type | Condition |
---|---|
ArgumentNullException | If the sting is a null reference (in Visual Basic Nothing). |
FormatException | If the string is not the correct format. |
Double numbers are never beyond the scope of Parse. When the numbers are large, they return positive infinity; when they are small, they return negative infinity.
Note that the Parse methods do not accept not a number (NaN), positive infinity, or negative infinity; instead PositiveInfinity, NegativeInfinity, or NaN will be returned. (For addition information, see PositiveInfinity, NegativeInfinity, and NaN.)
The output from ToString should be consumable by FromString.
The s parameter is a representation of a floating-point number. For example, "123.12 e5" and "123.12e 5" are not acceptable strings for s. The string must consist of an optional minus sign ("-") followed by a sequence of the digits one through nine (0-9).
An exception will be thrown if s does not match one of the following regular expressions:
Leading and trailing white space characters are ignored.For specific culture informtion, see CultureInfo and NumberFormatInfo.
Double Structure | Double Members | System Namespace | Double.Parse Overload List