0

Possible Duplicate:
String vs string in C#

Hello,

Should I prefer string or String in C# or is it execlty the same?

Community
  • 1
  • 1
Christophe Debove
  • 5,868
  • 19
  • 71
  • 121

2 Answers2

1

string is an alias of String..

Both create same IL

Demonstration

string sTest;

IL Creates

IL_0000:  ret 

String sTest;

IL Creates

IL_0000:  ret 

Its already asked so many times

anishMarokey
  • 11,041
  • 2
  • 32
  • 46
0

string is an alias System.String, they are the same. However, I would advise you to choose one and stick with it, so other people have an easier read.

Femaref
  • 59,667
  • 7
  • 131
  • 173