I'm trying to convert this string array to byte array.
string[] _str= { "01", "02", "03", "FF"};
to byte[] _Byte = { 0x1, 0x2, 0x3, 0xFF};
I have tried the following code, but it does not work.
_Byte = Array.ConvertAll(_str, Byte.Parse);
And also, it would be much better if I could convert the following code directly to the byte array :
string s = "00 02 03 FF"
to byte[] _Byte = { 0x1, 0x2, 0x3, 0xFF};
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…