CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Location
    Minneapolis
    Posts
    98

    [C#] converting a Byte array to a string

    does anyone have any idea about how to convert a byte array to a string in C#?

  2. #2
    Join Date
    Jan 2003
    Posts
    13
    Here you go:

    Code:
    byte[] bytes = {(byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'O'};
    Console.WriteLine(System.Text.ASCIIEncoding.ASCII.GetString(bytes));
    You can also use the UnicodeEncoding class when dealing with the unicode character set.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured