Hi All,
I need to convert string which I get from a textbox to an array.
string = "abcd"
will need as hex (array) to sent through comPort
result should be = [61 62 63 64]
thanks for helps
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Francis SusaimichaelPosted Dec 25, 2015, 1:54 PM
byte[] b = Encoding.Default.GetBytes(str);
var hexString = BitConverter.ToString(b);
string[] hexArray = hexString.Split('-');
ilhami caliskanPosted Dec 25, 2015, 2:49 PM