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
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

4 Comments

  1. MichaelM April 15, 2011 Reply
  2. Ryukk April 15, 2011 Reply
  3. Preeti Chauhan Kohli May 4, 2011 Reply
  4. String vs string in C# | ProgramInDotnet August 8, 2011 Reply

Leave a Reply


x

Interesting BlogPosts to read

How to get an Enumerator from range of elements from ArrayList in C# ?
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of ...
How to check for the column name in an SqlDataReader Object in C# ?
When working in ADO.NET for data access , there are times when you want to check to see if a column ...
Bing Search displays few school boards exam results
Looks like Bing now has a new feature that displays the results of various exams within Bing directl...