There is one practical difference between string
and String
.
nameof(String); // compilesnameof(string); // doesn't compile
This is because string
is a keyword (an alias in this case) whereas String
is a type.
The same is true for the other aliases as well.
| Alias | Type ||-----------|------------------|| bool | System.Boolean || byte | System.Byte || sbyte | System.SByte || char | System.Char || decimal | System.Decimal || double | System.Double || float | System.Single || int | System.Int32 || uint | System.UInt32 || long | System.Int64 || ulong | System.UInt64 || object | System.Object || short | System.Int16 || ushort | System.UInt16 || string | System.String |