Skip to content

Instantly share code, notes, and snippets.

@kendfrey
kendfrey / strtoascii.cs
Created April 23, 2012 23:22
String to ASCII
string str = "Hello!";
byte[] ascii = new byte[str.Length];
for (int i = 0; i < ascii.Length; i++)
{
ascii[i] = (byte)str[i];
}
This is a test.
Hello, world!