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!

Int16.Parse (String)

Converts a String to an Int16.

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

Parameters

s
The string to be interpreted.

Return Value

An Int16 with the value represented by s.

Exceptions

Exception Type Condition
ArgumentNullException If the string is a null reference (in Visual Basic Nothing).
FormatException If the string does not match the following regular expression: [0-9].
OverflowException If the string represents a number that is less than MinValue or greater than MaxValue.

Remarks

The Parse method converts a String to an Int16. The string must consist of an optional minus sign ("-") followed by a sequence of digits ("0"- "9").

Leading and trailing white space characters are ignored.

Note   Hexadecimal strings ("0x42") are not supported. Use Value or Convert ToIntxx(string, int) and ToUIntxx methods for the conversions.
Note   The Parse method does not accept not a number (NaN) or positive or negative infinity.

See Also

Int16 Structure | Int16 Members | System Namespace | Int16.Parse Overload List | String | Value | Convert | NaN | NaN | PositiveInfinity | PositiveInfinity | NegativeInfinity | NegativeInfinity