ally <sk*****@yahoo.com> wrote:
How can I convert a string to a ascii code in c#?
Do you mean a single character within a string? Just get the character,
e.g.
string h = "hello";
char c = h[3];
Now the character is the Unicode value, but all ASCII values are the
same in Unicode. So, for instance:
int i = c;
will make i be the ASCII code for 'l'.
(Converting to int isn't really necessary, but perhaps makes it
clearer.)
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too