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();
查看类型代码

猜你喜欢

转载自www.cnblogs.com/GoldenEllipsis/p/10354883.html
今日推荐