StringExtensions.AsInt Method

Definition

Overloads

AsInt(String)

Converts a string to an integer.

AsInt(String, Int32)

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

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

The value to convert.

Returns

The converted value.

Applies to

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

The value to convert.

defaultValue
Int32

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

Returns

The converted value.

Applies to