char[] and byte[] to string

  • Thread starter Thread starter Ohad
  • Start date Start date
O

Ohad

Hi,

I have (in c#):

byte b = new byte[12];
char c = new char[12];
string s;

How do I make s contain the data in b and c?
Please cc to my mailbox: (e-mail address removed)

Thanks a lot,
Ohad.
 
byte b = new byte[12];
char c = new char[12];
string s;

How do I make s contain the data in b and c?

s = new string(c);

For b, use the appropriate Encoding class from the System.Text
namespace.



Mattias
 
Back
Top