Possible Duplicate:
What is the difference between String.Empty and “”
Which one is better?
name = System.String.Empty;
OR
name = "";
Possible Duplicate:
What is the difference between String.Empty and “”
Which one is better?
name = System.String.Empty;
OR
name = "";
I use "" as it's considerably easier on the eye than String.Empty
. It hasn't caused me any problems as of yet, and I've been developing in .Net for years.
Edit: This is only true till .NET 1.1. as per What is the difference between String.Empty and "" (empty string)? not true for later versions.
If you say ""
you are creating a new object
, where as String.Empty
is a read-only field already initialized, it creates no object.