[英]Does C# have int8 and uint8?
I have four questions: 我有四个问题:
int8
C#是否具有int8
string
to int8
? 如果是这样,如何将string
转换为int8
? uint8
C#是否具有uint8
string
to uint8
? 如果那样我如何将string
转换为uint8
?
- Does C# have
int8
C#是否具有int8
Yes, it's called sbyte
是的,它叫做sbyte
- If so, how can I convert a
string
toint8
? 如果是这样,如何将string
转换为int8
?
Call sbyte.Parse
or sbyte.TryParse
调用sbyte.Parse
或sbyte.TryParse
- Does C# have
uint8
C#是否具有uint8
Yes, it's called byte
是的,这叫做byte
- If that how can I convert a
string
touint8
? 如果那样我如何将string
转换为uint8
?
Call byte.Parse
or byte.TryParse
调用byte.Parse
或byte.TryParse
I believe you can use sbyte
for signed 8-bit integers, as follows: 我相信您可以将sbyte
用于带符号的8位整数,如下所示:
sbyte sByte1 = 127;
You can also use byte
for unsigned 8-bit integers, as follows: 您还可以将byte
用于无符号的8位整数,如下所示:
byte myByte = 255;
Here are some links for sbyte
and byte
: 这是sbyte
和byte
一些链接:
General Integral type tables 通用整体类型表
sbyte documentation sbyte文档
byte documentation 字节文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.