My application gets data from a hardware device which is represented as a string, EG XYZ*012. I split the string up so I get “012” which I need to convert to an array of bytes.
The problem I have is that I want each digit to keep its value so the character “0” will be stored in a byte as 0 and character “1” will be stored in the byte as 1 etc. This is required because I need to work on the bits of the bytes. I’ve tried using the “GetBytes” command but it converts “0” into 48 which is not what I want.
Is there a command to do what I want or do I need to manually handle each character in the string separately in a loop?