StringExtensions.AsInt Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
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.