Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert character to hexadecimal value 2

Status
Not open for further replies.

KeyserSoze

Programmer
May 18, 2000
79
US
Is there a function in VB.NET 2003 to return the hexadecimal value of a character? For example, the hexadecimal value of character µ is B5.

Thanks!
 
This should would:
Code:
Dim intValue As Int32 = Convert.ToInt32(Asc([i]yourvaluehere[/i]))

[i]yourdestinationhere[/i] = intValue.ToString("X")

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
I think this is a bit more along the lines of what you are looking for:

Code:
    Dim s As String = "µ"
    Dim i As Integer = Asc(s)
    Dim h As String = Convert.ToString(i, 16)
    MsgBox("String: " & s & ControlChars.CrLf & _
           "ASCII: " & i & ControlChars.CrLf & _
           "Hex: " & h)

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
What's wrong with the built in Hex function?





Bob Boffin
 
You both get stars for your suggestions. Thanks again for the assist.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top