ConvertStringToInt(String,Int32) Method
- Last UpdatedNov 06, 2025
- 1 minute read
Converts the input string to a valid integer if appropriate; else the default string is returned back to the caller.
'Declaration
Public Overloads Shared Function ConvertStringToInt( _
ByVal InputValue As String, _
ByVal DefaultValue As Integer _
) As Integer
public static int ConvertStringToInt(
string InputValue,
int DefaultValue
)
Parameters
- InputValue
- The input string to convert as an integer.
- DefaultValue
- The default integer value if the input string is not a valid integer.
Return Value
Returns the converted integer value if success; otherwise default value.