Converts a String to a Single.
[Visual Basic] Overloads Public Shared Function ToSingle( _ ByVal value As String _ ) As Single [C#] public static float ToSingle( string value ); [C++] public: static float ToSingle( String* value ); [JScript] public static function ToSingle( value : String ) : float;
Returns the value as a Single.
Exception Type | Condition |
---|---|
ArgumentException | If value is null. |
FormatException | If value does not contain a representation that can be converted to a Single using the Parse(String) method implemented by that type. |
OverflowException | If value represents a number that is less than Single.MinValue or greater than Single.MaxValue. |
Implementation is the same as FromString.
Convert Class | Convert Members | System Namespace | Convert.ToSingle Overload List