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

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

$
0
0

string is a keyword, and you can't use string as an identifier.

String is not a keyword, and you can use it as an identifier:

Example

string String = "I am a string";

The keyword string is an alias forSystem.String aside from the keyword issue, the two are exactly equivalent.

 typeof(string) == typeof(String) == typeof(System.String)

Viewing all articles
Browse latest Browse all 69

Trending Articles



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