Skip to content

Instantly share code, notes, and snippets.

@PSingletary
Created December 27, 2019 16:20
Show Gist options
  • Select an option

  • Save PSingletary/c1aa438fc559915689e7111f5d8a897d to your computer and use it in GitHub Desktop.

Select an option

Save PSingletary/c1aa438fc559915689e7111f5d8a897d to your computer and use it in GitHub Desktop.
How to convert a string to a byte array and convert a byte array to a string - source: http://www.geekswithblogs.net/TimH/archive/2005/06/27/44849.aspx
System.Text.Encoding enc = System.Text.Encoding.ASCII;
byte[] myByteArray = enc.GetBytes("a text string");
string myString = enc.GetString(myByteArray );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment