SByte.TryParse tries to convert string to SByte equivalent
Module Example
Public Sub Main()
Dim numericStrings() As String = {"-3.6", "12.8", "+16.7", " 3 ", _
"(17)", "-17", "+12", "18-", "987", _
"1,024", " 127 "}
Dim number As SByte
For Each numericString As String In numericStrings
If SByte.TryParse(numericString, number) Then
Console.WriteLine("Converted '{0}' to {1}.", numericString, number)
Else
Console.WriteLine("Cannot convert '{0}' to an SByte.", numericString)
End If
Next
End Sub
End Module
Related examples in the same category