Get string from byte array
using System;
using System.Text;
class Utils
{
internal static string AsciiEncoding(byte[] data)
{
if (data == null || data.Length == 0)
return String.Empty;
return Encoding.ASCII.GetString(data, 0, data.Length).Replace("\0", "");
}
}
Related examples in the same category