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.ToInt16

Converts a specified string to an Int16 in the specified base.

[Visual Basic]
Overridable Public Function ToInt16() As Short
[C#]
public virtual short ToInt16();
[C++]
public: virtual short ToInt16();
[JScript]
public function ToInt16() : Int16;

Return Value

The Int16 representation of value as a base number .

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 Int16.MaxValue or less than Int16.MinValue.

Remarks

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

The ToInt16 implementation is the same as ToInt16. (In addition information, see Int16, Convert and Value.)

See Also

String Class | String Members | System Namespace