c#进制转换
2021-08-13 本文已影响0人
小兔哈尼
“AA BB CC”这种,在前面添加0x后可使用下面这种方法转换为数组
var command = str.Split(' ').Select(temp => "0x" + temp).Select(temp => (byte) Convert.ToInt32(temp, 16))
.ToArray();
“AA BB CC”这种,在前面添加0x后可使用下面这种方法转换为数组
var command = str.Split(' ').Select(temp => "0x" + temp).Select(temp => (byte) Convert.ToInt32(temp, 16))
.ToArray();