C# – Convert from byte array to string hex c#

arraysbytec++string

Suppose I have byte array.

byte[] a = new byte[] {0x33,0x43,0xFE};

I want to convert it to string.

 string str = convert(a);  

My str should look like this:

"33 43 FE"

How can I do that?

Best Solution

use bitconverter class

 BitConverter.ToString(Bytes);