XmlConvert.ToInt16(String) 方法

定义

String 转换为等效的 Int16Converts the String to a Int16 equivalent.

public:
 static short ToInt16(System::String ^ s);
public static short ToInt16 (string s);
static member ToInt16 : string -> int16
Public Shared Function ToInt16 (s As String) As Short

参数

s
String

要转换的字符串。The string to convert.

返回

Int16

与该字符串等效的 Int16An Int16 equivalent of the string.

例外

snulls is null.

s 的格式不正确。s is not in the correct format.

s 表示一个小于 MinValue 或大于 MaxValue 的数字。s represents a number less than MinValue or greater than MaxValue.

适用于