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

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

$
0
0

There are at least 4 differences:

1- string is a reserved word, but String is just a class name. This means that string cannot be used as a variable name by itself.

2- you can't use String without "using System".so you write less code by using "string".

3- 'String' is better naming convention than 'string', as it is a type not variable.

4- "string" is a C# keyword and syntax highlighted in most coding editors, but not "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>