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
Share