求助:
string裡面存的全是16進制的數據:“0x31,0x32,033”,
現需要將該數據賦值到byte[],有什麼好解決方案嗎??
string str = "0x31,0x32,0x33";
string[] chars = str.Split(',');
byte[] bytes = new byte[chars.Length];
for (int i = 0; i < chars.Length; i++)
{
bytes[i] = Convert.ToByte(chars[i], 16);
}