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!

String.ToUInt16

Converts a string to a UInt16 value.

[Visual Basic]
Overridable Public Function ToUInt16() As UInt16
[C#]
public virtual ushort ToUInt16();
[C++]
public: virtual unsigned short ToUInt16();
[JScript]
public function ToUInt16() : UInt16;

Return Value

The UInt16 representation of the string .

Exceptions

Exception Type Condition
ArgumentException If the string is not base 2, 8, 10, or 16.
ArgumentException If the string is null.
FormatException If the string cannot be parsed as a base number or the value represented is greater than UInt16.MaxValue or less than UInt16.MinValue.

Remarks

If the string is 16, the number may be preceded by "0x"; any other leading or trailing characters cause an error.

See Also

String Class | String Members | System Namespace