Recently I have heard a lot that string and String in C# are different so I wanted to make this post to say:
There is no functional difference between string and String. They both refer to the same type: System.String.

  • string is a C# keyword (alias for System.String).
  • String is the actual .NET type (System.String).

This same principle applies to other built-in types:

  • int (alias for System.Int32)
  • long (alias for System.Int64)
  • double (alias for System.Double)
  • bool (alias for System.Boolean)
  • object (alias for System.Object)

See you next week 🙂

Affiliate promo

If you love learning new stuff and want to support me, consider buying a course from Dometrain using this link: Browse courses – Dometrain. Thank you!

Leave a comment

Trending