There is a code:
public static string GetString(byte[] bytesArray) { string result = string.Empty; for (var i = 0; i < bytesArray.Length; i++) { result += string.Format("0x{0:x2}", bytesArray[i]); if (i != bytesArray.Length - 1) { result += ", "; } } return result; } How to reverse convert a string to a byte [] array?
+=string variable in a loop! - Pavel Mayorov