Converts a specified String to a Double.
[Visual Basic] Public Shared Function FromString( _ ByVal s As String _ ) As Double [C#] public static double FromString( string s ); [C++] public: static double FromString( String* s ); [JScript] public static function FromString( s : String ) : double;
The Double value represented by the specified string.
Exception Type | Condition |
---|---|
ArgumentNullException | If the string is a null reference (in Visual Basic Nothing). |
FormatException | If the number is not formatted correctly. |
This method will not throw an OverflowException. Instead, it returns PositiveInfinity or NegativeInfinity if the number is too large or too small.
This method does a round-trip, to and returned to ToString, because it uses the invariant NumberFormatInfo. Use the Parse method for parse user-dependent or locale-specific strings The default (locale-neutral) NumberFormatInfo is used. (For addition inforamtion about cultures, see CultureInfo.)
The s parameter returns an expected format that is produced as if Format(format, sp) were called with the general ('G') format character and the invariant NumberFormatInfo.
Double Structure | Double Members | System Namespace | String | Format