String vs string in c#

This post will explain what is the difference between string and String in C#. How do you create a string variable in c# ?

Do you use String or string class in .NET ?

Confused with the above text . Well its just that we use either the keyword string or we use String.

Is both String and string same in C# ?

string is just an alias name for the class System.String which means both has the same functionalities .The IL code generated for both of them is also same .

Note that string is a keyword , but String isn’t which lets you create an identifier with the name String like

String String ="Senthil kumar" ;

Copy link
Powered by Social Snap