发布于 2010-11-16 05:51:17
实际上,string是System.String的别名,但erash基本上是正确的.
以下是this post中乔恩·斯基特( Jon )提出的其他别名“无耻”的列表
* object: System.Object
* string: System.String
* bool: System.Boolean
* byte: System.Byte
* sbyte: System.SByte
* short: System.Int16
* ushort: System.UInt16
* int: System.Int32
* uint: System.UInt32
* long: System.Int64
* ulong: System.UInt64
* float: System.Single
* double: System.Double
* decimal: System.Decimal
* char: System.Char发布于 2010-11-16 05:50:23
它们是相同的,字符串是字符串的别名。
在调用静态方法时,我倾向于使用字符串(即String.Format(.)或String.IsNullOrEmpty(.)我不知道为什么,我就是知道。
发布于 2010-11-16 05:49:18
string只是String的别名--它们是一样的
编辑:类型固定
https://stackoverflow.com/questions/4191532
复制相似问题