How do you convert a string into hexadecimal in VB.NET?

vb.net

Solution

Dim val As String
val = "10"
Dim hexVal As Integer
hexVal = Convert.ToInt32(val, 16) //16 specifies the base
Console.WriteLine(hexVal)

This will display 16 which is the integer equivalent of the hexadecimal string "10".

Problem

How do I convert a string from a textbox into hexadecimal? I have only found ways in C#. Does VB.NET have the ability to do such a thing? If it can then I'd like to know how to convert string to hex and hex to string.

Original source

Related problems