Re: String to Hex



Well, if you are will to accept dashes in the string, it's just :

string input = "ATL100";
string output =
BitConverter.ToString(System.Text.Encoding.ASCII.GetBytes(input));
Console.WriteLine(output);

41-54-4C-31-30-30

--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
"DanO" <ohallord@xxxxxxxxx> wrote in message
news:1132240644.855880.80310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I am trying to convert a text string in to hex values. I am at a loss
> of how to get this done. I am also some what new to VC I have worked in
> Unix C for a while though.
>
> I am been searching the web for this but can't find the solution I am
> looking for.
>
> For example I need to convert the following
>
> ATL100
>
> to the hex equivlent string.
>
> 41544C 3130 30
>
> A function or something would be helpful.
>


.



Relevant Pages