Possible Duplicate:
What is the difference between String.Empty and “”
Which of the following should I use for assigning an empty string and why?
string variableName = "";
or
string variableName = string.Empty;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
String.Emptyis what is normally recommended.Why? Because it conveys meaning, you are very explicitly saying that you want the string to be empty.
Additionally,
""creates a string object (this object will be reused across the applications, because strings in .NET are interned),String.Emptydoes not create a new object. See here.