Convert Byte[] array to string C#

Status
Not open for further replies.

rkt_167

Junior Member level 1
Joined
Aug 9, 2013
Messages
19
Helped
3
Reputation
6
Reaction score
3
Trophy points
3
Activity points
163
hi all,
I want to convert byte array in string array as:
byte[] data={11,12,13,14};
should be:
string[] datastring={"11","12",13","14"};
means I don't want to change the data only data type needs to be changed... Give syntax ..

thanks,
 

example using ToString()
Code:
          byte[] data={11,12,13,14};
         string[] datastring = new string[data.Length];
         for (int i = 0; i < data.Length; i++)
         {
             datastring[i] = data[i].ToString();
             Console.WriteLine("btye {0} string {1}", data[i], datastring[i]);
         }
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…