System.Xml.XmlConvert.ToUInt16 Method

Converts the string to a ushort equivalent.

Syntax

[System.CLSCompliant(false)]
public static ushort ToUInt16 (string s)

Parameters

s
The string to convert.

Returns

A UInt16 equivalent of the string.

Exceptions

TypeReason
ArgumentNullException s is a null reference.
FormatException s is not in the correct format.
OverflowException s represents a number less than ushort.MinValue or greater than ushort.MaxValue.

Remarks

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0