ConvertDataTypes.comConvert data types programming in one click !

Convert Byte() to String in VB.net

    40722 hits
  • Dim vIn() As Byte = new Byte(){"F","O","O"}
  • Dim vOut As String = System.Text.Encoding.UTF8.GetString(vIn)
  • 'Note : if the Byte array is encoded with another encoding,
  • 'replace UTF8 by :
  • 'System.Text.Encoding.ASCII;
  • 'System.Text.Encoding.BigEndianUnicode;
  • 'System.Text.Encoding.Unicode;
  • 'System.Text.Encoding.UTF32;
  • 'System.Text.Encoding.UTF7;
  • 'System.Text.Encoding.UTF8;
  • 'System.Text.Encoding.Default : based on the Windows API GetACP
  • 'which returns the Windows ANSI code page identifier for the
  • 'operating system