请教字节数组转16进字符串
public static byte[] smethod_2(string string_0)
{
byte[] array = new byte[string_0.Length / 2];
for (int i = 0; i < string_0.Length; i += 2)
{
array[i / 2] = Convert.ToByte(string_0.Substring(i, 2), 16);
}
return array;
}
这个是字符串转数组
怎么写数组转字符串方法
------解决方案--------------------
哦,不好意思,我写反了
string s = string.Join("", bytes05.Select(x => x.ToString("x2"));