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
  • 6,088
  • 20
  • 73
  • 124

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,279
  • 2
  • 34
  • 47
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
  • 60,705
  • 7
  • 138
  • 176