Please, avoid the usage of past decade VB6
methods while you are programming in VB.NET
, methods such as HEX
and ASC
can be replaced with the methods provided by the Convert
Class.
var = Convert.ToString(Convert.ToInt32(letter), 16)
And place your code here:
If char1.Contains(letter) Then
' Here the instructions to do when a character is found...
Else
An Example:
Dim AscChars As Char() =
"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ " _
& Environment.NewLine
Dim HexValue As String = String.Empty
Dim sb As New System.Text.StringBuilder
For Each c As Char In AscChars
HexValue = Convert.ToString(Convert.ToInt32(c), 16)
sb.Clear()
sb.AppendLine(String.Format("ASC: {0}", CStr(c)))
sb.AppendLine(String.Format("HEX: {0}", HexValue))
MessageBox.Show(sb.ToString, "Character conversion")
Next c