Re: String to Hex
- From: "James Curran" <jamescurran@xxxxxxxx>
- Date: Mon, 21 Nov 2005 15:29:32 -0500
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.
>
.
- References:
- String to Hex
- From: DanO
- String to Hex
- Prev by Date: Re: Switch statement on string in C++
- Next by Date: /clr vs /clr pure
- Previous by thread: String to Hex
- Next by thread: executing a child method when pointed to by a base class pointer
- Index(es):
Relevant Pages
|