Difference between string and String in C#

By | December 17, 2015

string is an alias in C# for System.String. So technically, there is no difference. It’s like int vs. System.Int32.You can use whichever you prefer, although I generally use string when I’m planning on using it much like a primitive data type (similar to int, float, or bool) and String when I’m planning on using it as an object/class.


string place = "world";
string greet = String.Format("Hello {0}!", place);
Like it? Share it