Convert string to byte?

I’ve searched the entire internet and couldn’t find the answer :frowning:

How to convert string to byte !?

http://stackoverflow.com/questions/16072709/converting-string-to-byte-array-in-c-sharp

2 Likes

I found that too but I needed to convert the string a byte not byte array. Anyways I solved my problem with this:

string myString = “100”;
int myInt = int.Parse(myString);
byte myByte = (byte)myInt;

hummina waa, oh… kay?

Malformed question.

3 Likes

You can’t make a string into a byte, unless it is a single letter as each letter is a byte. How many bits or bytes are there in a character? - Stack Overflow

1 Like

some characters depending on the encoding are greater than a byte as well such as some of the utf8 charsters