This is a short knowledge base article where I would like to clear a common doubt which I also faced when I was new.
1. What is the difference between string and String?
2. Which one to use and when?
So the answer is both are one and the same and both can be used. But it is recommended to use the shorter version i.e. string as that is the alias for the class System.String.
In other words the String represents the System.String class while the string is the keyword for the System.String that we can use to create string objects.
Here’s the MSDN reference for the different keywords for different classes Built-In Types Table
This same explanation can be used to explain the difference between bool and Boolean
With this we come to the end of this short article. Hope you like it.
Difference between string and String