There is no difference.
string
is the C# alias to
String
(which is really
System.String
). When the code compiles, all of your
string
types are converted to
System.String
in the IL.
Personally, I prefer using
string
when I am typing a variable and
String
when I am acessing static members of the class. This is only personal preference as I think it makes the code easier to follow. There is nothing wrong with code like:
bool empty = string.IsNullOrEmpty("");
instead of
bool empty = String.IsNullOrEmpty("");