Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

13
  • 198
    If you decide to use StyleCop and follow that, that will say to use the types specific to the language. So for C# you'll have string (instead of String), int (instead of Int32), float (instead of Single) - stylecop.soyuz5.com/SA1121.html Commented May 22, 2012 at 22:36
  • 195
    I always use the aliases because I've assumed one day it might come in handy because they are acting as an abstraction, so therefore can have their implementations changed without me having to know. Commented Oct 12, 2012 at 23:25
  • 64
    Visual Studio 2015 says that String.Format should be changed to string.Format, so I guess Microsoft is going that way. I have also always used String for the static methods. Commented Dec 22, 2014 at 5:21
  • 5
    What do you say to the fact that you could define your own type “String” but can’t do the same for “string” as it’s a keyword, as explained in stackoverflow.com/questions/7074/… Commented Oct 13, 2020 at 21:37
  • 5
    I gues then... Just be conistent. Use string or String or use a cerntain one in a specific case, but always in that case. Commented Nov 29, 2020 at 6:50

lang-cs