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!

UInt16.Parse (String, NumberStyles, NumberFormatInfo)

Converts a String representation of a value to an UInt16 with the NumberStyles enumeration formatted by NumberFormatInfo. The UInt16 type is not CLS compliant. The CLS-compliant alternative is Int16.

[C#]
public static ushort Parse(
   string s,
   NumberStyles style,
   NumberFormatInfo info
);
[C++]
public: static unsigned short Parse(
   String* s,
   NumberStyles style,
   NumberFormatInfo* info
);
[JScript]
public static function Parse(
   s : String,
   style : NumberStyles,
   info : NumberFormatInfo
) : UInt16;

[Visual Basic] The UInt16 type cannot be used in Visual Basic.

Parameters [C#, C++, JScript]

s
The string to be interpreted.
style
The permitted style of the numeric string.
info
The NumberFormatInfo instance used to format the string.

Return Value [C#, C++, JScript]

A UInt16 with the value represented by s.

Exceptions [C#, C++, JScript]

Exception Type Condition
ArgumentException If the style is not a NumberStyles enumeration.
ArgumentNullException If the string is a null reference (in Visual Basic Nothing).
FormatException If the string is not of the correct format.
OverflowException If the string represents a number that is less than MinValue or greater than MaxValue.

See Also

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