mca*_*s20 34 c# string
可能重复: 在C#中,String和string之间有什么区别
我应该使用string或String在c#中声明一个基本的字符串变量,这有关系吗?
string
String
Gre*_*reg 28
我喜欢string因为VS用深蓝色突出显示它(这使得它非常棒).
Jef*_*nal 17
没关系,尽管最好保持一致:小写string 是别名String.
jjn*_*guy 6
该string关键字的别名System.String。
System.String
(同样适用int - System.Int32 long - System.Int64等等)
int - System.Int32
long - System.Int64
C# 不像 Java 那样有两种不同的原语表示。(其中 an 与 anint有很大不同Integer)
int
Integer
在大多数情况下,最好使用小写字母,string因为它是完全限定的System.String. 如果String您的代码中存在另一种类型,您可以通过这种方式避免类型冲突。
归档时间:
15 年,6 月 前
查看次数:
14768 次
最近记录:
10 年,9 月 前