Wednesday, January 20, 2010

I want to get ASCII value of string in C#, what can I do?

Sample Code:

string value = "9quali52ty3";

// Convert the string into a byte[].
byte[] asciiBytes = Encoding.ASCII.GetBytes(value);

Result:

57 113 117 97 108 105 53 50 116 121 51

No comments: