String
and
string
mean exactly the
same thing in C#.
As you stated in your question
string
, is an
alias for
String
for
System.String.
It seems that the convention is to use
string
when you are referring to an
object and
String
when you are referring specifically to the
string class.
You can use them interchangeably in your code.
String x = string.Copy ("x");
string y = String.Copy ("y");
Use "String" to refer specifically to the String class.
Use "string" when referring to an object of the String class.
Referred from here[^]
Look at good article on CP:
More detailed explanation about
String.IsNullOrEmpty[
^]