I have this byte[]: 00 28 00 60 00 30 10 70 00 22 FF FF
.
I want to combine each pair of bytes into a word: 0028 0060 0030 1070 0022 FFFF
.
I also want to turn the word array into a string: "0028 0060 0030 1070 0022 FFFF"
(without using byte[]
).
I fixed SLaks code and it works:
StringBuilder sb = new StringBuilder();
for(var i = 0; i < words.Length; i++)
{
sb.AppendFormat("{0:X4} ", words[i]);
}