共用方式為


StringExtensions.AsInt 方法

定義

多載

AsInt(String)

將字串轉換成整數。

AsInt(String, Int32)

將字串轉換成整數並指定預設值。

AsInt(String)

將字串轉換成整數。

public static int AsInt (this string value);
static member AsInt : string -> int
<Extension()>
Public Function AsInt (value As String) As Integer

參數

value
String

要進行轉換的值。

傳回

轉換的值。

適用於

AsInt(String, Int32)

將字串轉換成整數並指定預設值。

public static int AsInt (this string value, int defaultValue);
static member AsInt : string * int -> int
<Extension()>
Public Function AsInt (value As String, defaultValue As Integer) As Integer

參數

value
String

要進行轉換的值。

defaultValue
Int32

如果 value 為 null 或為無效值,則傳回的值。

傳回

轉換的值。

適用於