Converts a specified value to a 32-bit signed integer. Empty strings are converted to zero. Boolean values are converted to zero for false or one for true. All other conversions are done using NumberFormatInfo.InvariantInfo. If the conversion fails an exception is thrown.
int ToInt(object value)
value |
The value to convert. |
Example
ToInt("12")
Returns the integer value 12.