HOWTO: Convert a String to a Byte Array (byte[])

Just so I don’t forget, here is how to convert a string to a byte array:

System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();


Comments (1)
  1. Garry Trinder says:

    If you’re dealing with non-English languages you might wanna use UTF8/UTF16?

Comments are closed.

Skip to main content