Int32.Parse Method Converts string to 32-bit signed integer equivalent.
Module ParseInt32
Public Sub Main()
Convert(" +809 ")
End Sub
Private Sub Convert(value As String)
Try
Dim number As Integer = Int32.Parse(value)
Console.WriteLine("Converted '{0}' to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to convert '{0}'.", value)
End Try
End Sub
End Module
Related examples in the same category