It’s easy to convert a string to a byte array.  For an ASCII string, use the Encoding.ASCII.GetBytes static method:

string s = "Test String";
byte[] byteArray = Encoding.ASCII.GetBytes( s );

Popularity: 3% [?]

Related posts:

  1. C# Convert Byte Array to String
  2. C# Convert String to Stream, and Stream to String
  3. Read File into Byte Array
  4. Convert Binary to Base64 String
  5. Sort C# Array in Descending/Reverse Order