Yes, depending upon the encoding of the data, you can use System.Text encoding utilities. Following assumes the ASCII encoding.
The encoding ignores the unprintable characters.Code:using System; using System.Text; public class Me { public static void Main(string[] args) { byte[] bdata = new byte[] {0x30, 0x31, 0x32, 0x01, 0x39}; // some gibberish in the middle string str = Encoding.ASCII.GetString(bdata); Console.WriteLine(str); } }




Reply With Quote