C#

Convert byte array to String in C#

Assuming that byte array contains data in Unicode format:

byte[] data = ....;
String data_s = Encoding.Unicode.GetString(data);

Assuming that byte array contains data in ASCII format:

byte[] data = ....;
String data_s = Encoding.ASCII.GetString(data);