StringExtensions.AsInt StringExtensions.AsInt StringExtensions.AsInt Method

Definition

Overloads

AsInt(String) AsInt(String) AsInt(String)

Converts a string to an integer.

AsInt(String, Int32) AsInt(String, Int32) AsInt(String, Int32)

Converts a string to an integer and specifies a default value.

AsInt(String) AsInt(String) AsInt(String)

Converts a string to an integer.

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

The value to convert.

Returns

The converted value.

AsInt(String, Int32) AsInt(String, Int32) AsInt(String, Int32)

Converts a string to an integer and specifies a default value.

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
Parameters
value
String String String

The value to convert.

defaultValue
Int32 Int32 Int32

The value to return if value is null or is an invalid value.

Returns

The converted value.

Applies to