Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. converting array of byte to string in c#

converting array of byte to string in c#

Scheduled Pinned Locked Moved C#
csharpdata-structurestutoriallearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi all, I am a Beginner to c#. I Need to convert array of byte data type to string. How to do this.. ex: byte[] bytes = new byte[1000]; this bytes get filled up. Now I need to convert to string. How to do this..

    A 1 Reply Last reply
    0
    • L Lost User

      Hi all, I am a Beginner to c#. I Need to convert array of byte data type to string. How to do this.. ex: byte[] bytes = new byte[1000]; this bytes get filled up. Now I need to convert to string. How to do this..

      A Offline
      A Offline
      Andrew Kirillov
      wrote on last edited by
      #2

      Hello You use the next code:

      byte[] bytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x45 };
      string str = System.Text.Encoding.ASCII.GetString( bytes );
      System.Diagnostics.Debug.WriteLine( str );
      

      With best regards, Andrew Kirillov, MCP x 3 Prize winner, August 2005

      T 1 Reply Last reply
      0
      • A Andrew Kirillov

        Hello You use the next code:

        byte[] bytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x45 };
        string str = System.Text.Encoding.ASCII.GetString( bytes );
        System.Diagnostics.Debug.WriteLine( str );
        

        With best regards, Andrew Kirillov, MCP x 3 Prize winner, August 2005

        T Offline
        T Offline
        tssp
        wrote on last edited by
        #3

        hi Kirillov, Thanks a lot.. Worked and my problem is solved.. Have a nice day.. Shiva P

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups