Is there a buil in function that will take a string and return a byte array?
System.BitConverter.GetBytes only accepts a char. I want to pass in a string of x number of characters.
Thanks,
Printable View
Is there a buil in function that will take a string and return a byte array?
System.BitConverter.GetBytes only accepts a char. I want to pass in a string of x number of characters.
Thanks,
Yes like this;
System.Text.Encoding.ASCII.GetBytes(YourString)
(you could use other text encoding, I just used ASCII for the example)