开发者

Should I prefer string or String in C# or is it execlty the same? [duplicate]

This question already exists: Closed 11 years ago.

Possible Duplicate:

String vs string in C#

Hello,

Should I prefer string or String in C# or is it execl开发者_高级运维ty the same?


string is an alias of String..

Both create same IL

Demonstration

string sTest;

IL Creates

IL_0000:  ret 

String sTest;

IL Creates

IL_0000:  ret 

Its already asked so many times


string is an alias System.String, they are the same. However, I would advise you to choose one and stick with it, so other people have an easier read.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜