Share via


XmlConvert.ToInt16(String) 方法

定義

String 轉換成對等的 Int16

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

要轉換的字串。

傳回

字串的對等 Int16

例外狀況

snull

s 的格式不正確。

s 代表小於 Int16.MinValue 或大於 Int16.MaxValue的數位。

適用於