ConversionToInt32(String, Int32) Method

Return a number converted to Int32, with no exception thrown in the case that the specified value is not valid.

Definition

Namespace: Html
Assembly: Html (in Html.dll) Version: 25.2822.3845
C#
public static int ToInt32(
	string value,
	int defaultValue
)

Parameters

value  String
Value to convert to an Int32.
defaultValue  Int32
The default value to return if the value can not be converted.

Return Value

Int32
If the caller's value was valid, an Int32 representation of that value. Otherwise, the caller's specified default value.

See Also