Convert String to Byte Array


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public static byte[] ToByteArray(string str)
  2. {
  3. System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
  4. return encoding.GetBytes(str);
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.