Quantcast
Channel: What is the difference between String and string in C#? - Stack Overflow
Viewing all articles
Browse latest Browse all 69

Answer by wild coder for What is the difference between String and string in C#?

$
0
0

First of All, both string& String are not same.There is a difference:String is not a keyword and it can be used as an identifier whereas string is a keyword and cannot be used as identifier.

I am trying to explain with different example :First, when I put string s; into Visual Studio and hover over it I get (without the colour):
String Definition

That says that string is System.String, right?The documentation is at https://msdn.microsoft.com/en-us/library/362314fe.aspx. The second sentence says "string is an alias for String in the .NET Framework.".


Viewing all articles
Browse latest Browse all 69

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>