I have four questions:
int8
string
to int8
?uint8
string
to uint8
?
- Does C# have
int8
Yes, it's called sbyte
- If so, how can I convert a
string
toint8
?
Call sbyte.Parse
or sbyte.TryParse
- Does C# have
uint8
Yes, it's called byte
- If that how can I convert a
string
touint8
?
Call byte.Parse
or byte.TryParse
I believe you can use sbyte
for signed 8-bit integers, as follows:
sbyte sByte1 = 127;
You can also use byte
for unsigned 8-bit integers, as follows:
byte myByte = 255;
Here are some links for sbyte
and byte
:
General Integral type tables
sbyte documentation
byte documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With