Click here to Skip to main content
15,878,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! I have a trouble. I have a textbox with data as string like "E4". How to convert this textbox.text data to a equal hex number E4? "E4" to &HE4
Updated 6-Apr-13 7:03am
Zoltán Zörgő 6-Apr-13 13:10pm    
What about appending "&H" at the beginning?
Roman Gaisin 6-Apr-13 13:16pm    
No matter, I only have a string 4E and have to convert it into a HEX number 4E

Hexadecimal, octal, decimal, binary: they are only representations of the same number. There is no hex number 4E, there is only the value 78. You can parse the hexadecimal representation to get this value, and thank back again to your desired format - but do you really need this?
Check following code lines one by one:
var input = "4E";
var x = Convert.ToInt32(input, 16);
Share this answer
You would absolutely be amazed to find this:[^]

Pleas read the documentation before posting a question. :)
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900