Tuesday, July 28, 2009

How do you translate string in c# to ascii code.....??.. and vice versa?

I am a beginner in c# trying to create a program that given a returns b... etc...

How do you translate string in c# to ascii code.....??.. and vice versa?
There's an asciiencodingclass, but you don't need that.





You can convert chars (or bits of strings) to bytes and back again. SO to convert a to b:


char c = 'a';


byte b = (byte) c;


b++;


char c = (char) b;


No comments:

Post a Comment