Imports System
Public Module Module1
Public Sub Main()
Dim char_array() As Char = { "a", "g", "x" }
For Each ch As Char in char_array
Try
Dim b As Byte = Convert.ToByte(ch)
Console.WriteLine("{0} converted to {1}", ch, b)
Catch ex As OverflowException
Console.WriteLine("Unable to convert")
End Try
Next
End Sub
End Module
'
' run:
'
' a converted to 97
' g converted to 103
' x converted to 120
'