I have a string:
LogoDataStr = "ABC0000"
I want to convert to ASCII bytes and the result should be:
LogoDataBy[0] = 0x41;
LogoDataBy[1] = 0x42;
LogoDataBy[2] = 0x43;
LogoDataBy[3] = 0x30;
LogoDataBy[4] = 0x30;
LogoDataBy[5] = 0x30;
LogoDataBy[6] = 0x30;
I've tried using this way:
byte[] LogoDataBy = ASCIIEncoding.ASCII.GetBytes(LogoDataStr);
But the result I get is this:
LogoDataBy[0] = 0x41;
LogoDataBy[1] = 0x42;
LogoDataBy[2] = 0x43;
LogoDataBy[3] = 0x00;
LogoDataBy[4] = 0x00;
LogoDataBy[5] = 0x00;
LogoDataBy[6] = 0x00;
Is there any wrong with my coding?