Skip to content

Instantly share code, notes, and snippets.

@kendfrey
Created April 23, 2012 23:22
Show Gist options
  • Save kendfrey/2474500 to your computer and use it in GitHub Desktop.
Save kendfrey/2474500 to your computer and use it in GitHub Desktop.
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];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment