Difference between "" and String.Empty() [duplicate]
Possible Duplicate:
开发者_如何学编程 What is the difference between String.Empty and “”
What is the difference between code and where it is applicable??
string mystr = "";
string mystr1 = String.Empty();
The answer appears to be 'nothing'.
However, good programming practice says that you should preferably use string.Empty, as if in the future an empty string were to be represented by something other than "", your code otherwise might break. (I can't see tha change happening, but in principle it might).
I think this will explain it for you: http://msdn.microsoft.com/en-us/library/system.string.empty.aspx
精彩评论