Question: 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.

Answer: 
To convert into hexadecimal, use `Convert.ToInt32(val, 16)`. Convert.ToInt32 supports limited bases, 2, 8, 10, and 16.

To convert into any base, use:

```
Public Shared Function IntToString(value As Integer, baseChars As Char()) As String
    Dim result As String = String.Empty
    Dim targetBase As Integer = baseChars.Length

    Do
        result = baseChars(value Mod targetBase) + result
        value = value / targetBase
    Loop While value > 0

    Return result
End Function

```

The above function comes from [this question](https://stackoverflow.com/questions/923771/quickest-way-to-convert-a-base-10-number-to-any-base-in-net). The C# to VB conversion was done [using this](http://converter.telerik.com/).
Short and effective **expression to display all characters of String `s` in hexadecimal form** can be written using LINQ:

```
String.Join(" ", s.Select(Function(c) Conversion.Hex(AscW(c)).PadLeft(4, "0")).ToArray()))

```

**Example:**

For string `► fix` it gives string `25BA 0020 0066 0069 0078`.

Enjoy!

Please keep in mind this is **Unicode-enabled**, returning 4-digit hexadecimal value for every character, because old plain Non-Unicode ASCII is dead and you should no longer rely on it in any application.