Posted By

Anthony on 06/17/08


Tagged

array String byte convert


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

jimfred
umang_nine
ddevening
itsvetkov
vali29
ethedy
khouser
tonicglop
ovuncgursoy


Convert String to Byte Array


 / Published in: C#
 

  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
Posted By: bobpombrio on November 12, 2008

Sweet - probably the cleanest one I've found. Thanks

You need to login to post a comment.