C# string 与 String的区别

Posted on 2019-02-07 15:52  金色的省略号  阅读(181)  评论(0编辑  收藏  举报

C# string 与 String的区别

The string type represents a string of Unicode characters.

string is an alias for System.String in the .NET Framework.  

string is a reference type,object is a reference type too, and the others are value types.

string是C#的保留字,而String是CLR(Common Language Runtime)的类型.

 

int x = 5;
Console.Write(x.GetType());//System.Int32
Console.ReadLine();
查看类型代码