There is really no difference from the point of view of performance and code generated. In performance tests, they went back and forth, among which one was faster against the other, and only for milliseconds.
In looking at the behind the code, you really do not see any difference either. The only difference is
IL , which
string.Empty use the
"" operation code uses the
ldstr operation code, but this is just because
string.Empty is static, and both statements do the same thing.
If you look at the set of what is produced, it is exactly the same.
One difference is that if you use the syntax of a
switch-case , you can not write
case string.Empty: because it is not a constant and you will have
Compilation error : A constant value is expected .
As in the example below.
public class Program
public static void Main()
string teste = "";
Compilation error (line 14, col 9): A constant value is expected
So user what you find more readable, however. It is subjective and varies from person to person - so I suggest you find out what most people on your team use, and who all do the consistency.
I personally find
String.Empty easier to read.