What’s the difference between string and System.String?

Avatar

C# defines a number of aliases for CLR types. They may be used interchangably, and even mixed together, e.g.

string x = new System.String(' ', 5);.

These are the aliases defined:

AliasCLR type
stringSystem.String
sbyteSystem.SByte
byteSystem.Byte
shortSystem.Int16
ushortSystem.UInt16
intSystem.Int32
uintSystem.UInt32
longSystem.Int64
ulongSystem.UInt64
charSystem.Char
floatSystem.Single
doubleSystem.Double
boolSystem.Boolean
decimalSystem.Decimal

[Author: Jon Skeet]

Avatar

Follow    

Tagged

No Comments.