Posts tagged Byte array to String (vice versa)
Byte array to String (vice versa)
Feb 26th
1: public static string BytesToString(byte[] bytes) 2: { 3: ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 4: return enc.GetString(bytes); 5: } 1: public static byte[] StringToBytes(string str) 2: { 3: ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 4: return enc.GetBytes(str); 5: }