Share via


XmlConvert.ToInt32(String) 方法

定義

String 轉換成對等的 Int32

public:
 static int ToInt32(System::String ^ s);
public static int ToInt32 (string s);
static member ToInt32 : string -> int
Public Shared Function ToInt32 (s As String) As Integer

參數

s
String

要轉換的字串。

傳回

字串的對等 Int32

例外狀況

snull

s 的格式不正確。

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

適用於