New! GraphQL.NET Cookbook by Senthil Kumar Balu

String vs string in c#

How do you create a string variable in c# ?

String ? string ?

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 indentifier with the name String like

String String ="Senthil kumar" ;
C# String Theory—string versus String has some interesting information about Strings and best practises on strings
Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.