开发者

In C#. What is the differences between String and string? [duplicate]

开发者 https://www.devze.com 2023-03-23 22:44 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: In C# what is the difference between String and string
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

In C# what is the difference between String and string

In C# there are two string types. (The same for booleans, object, ect.). One that begins with upperc开发者_JAVA百科ase and one lowercase. String and string. They seem to have the same methods.

So whats is the difference between them?


string is a keyword, while System.String is a class. You can consider string to be an alias for System.String.


There is one difference... you can't use String without using System; beforehand.

What is the difference between String and string in C#?

0

精彩评论

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