converting

Ugojallas

Member
Joined
Apr 5, 2012
Messages
12
Programming Experience
Beginner
i am writing an application that can convert words to hexdecimal eg i want if i type something like (i will come) in one richtextbox it will convert to its hexdecimal equivalent in another richtextbox
 
A the previous said, you'll have to run through each character and find its hexadecimal equivalent. So, a simple way to do that would be when they hit a button
C#:
for(int c = 0; c < textBox1.Text.Length; c++)
{
    textBox2.Text += convert2hex(textBox1.Text[c]);
}

That will loop through the characters in textBox1 and add them to textBox2. But you'll have to write a function to do the actual converting. convert2hex was made up by myself.

Here's a video showing how you would convert: How to Convert a Decimal Number to a Hexadecimal Number - YouTube
 
Back
Top Bottom