NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Single.Parse (String)

Converts a String to a Single with the default format.

[Visual Basic]
Overloads Public Shared Function Parse( _
   ByVal s As String _
) As Single
[C#]
public static float Parse(
   string s
);
[C++]
public: static float Parse(
   String* s
);
[JScript]
public static function Parse(
   s : String
) : float;

Parameters

s
A string that represents a floating point number to be converted to a Single.

Return Value

Returns the Single value of the string parameter.

Exceptions

Exception Type Condition
ArgumentNullException If the string is a null reference (in Visual Basic Nothing).
FormatException If the string is not a real number.

Remarks

It is not acceptable for the s parameter to contain the expressions of "123.12 e5" and "123.12e 5".

The s parameter should match one of the following regular expressions:

Leading and trailing white space characters are ignored.

The Parse method does not throw a FormatException if the string is not a number (see NaN); it returns NaN instead. Nor does it throw an OverflowException; it returns PositiveInfinity or NegativeInfinity if the number is too large or too small.

See Also

Single Structure | Single Members | System Namespace | Single.Parse Overload List | FromString | ToString