String vs string

Possible Duplicate:
In C# what is the difference between String and string

Should I use string or String when declaring a basic string variable in c# and does it matter?


这并不重要,但最好保持一致:小写stringString的别名。


我喜欢string因为VS以深蓝色突出显示(这使得它变成了awesomer)。


The string keyword is an alias for System.String .

(The same goes for int - System.Int32 long - System.Int64 and so on)

C# doesn't have two different representations for primitives the same way that Java does. (Where an int is far different from an Integer )

In most cases it is best to use lowercase string because it is an alias to the fully qualified System.String . This way you can avoid type conflicts if there is another String type somewhere in your code.

链接地址: http://www.djcxy.com/p/3592.html

上一篇: C#字符串与字符串,布尔与布尔

下一篇: 字符串与字符串