This documentation is archived and is not being maintained.

XmlConvert.ToInt16 Method

Converts the String to a Int16 equivalent.

[Visual Basic]
Public Shared Function ToInt16( _
   ByVal s As String _
) As Short
public static short ToInt16(
 string s
public: static short ToInt16(
 String* s
public static function ToInt16(
   s : String
) : Int16;


The string to convert.

Return Value

An Int16 equivalent of the string.


Exception Type Condition
ArgumentNullException s is a null reference (Nothing in Visual Basic).
FormatException s is not in the correct format.
OverflowException s represents a number less than Int16.MinValue or greater than Int16.MaxValue.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlConvert Class | XmlConvert Members | System.Xml Namespace