I put together a quick test case instantiating both types and looked at
the modules through ILDasm. The only difference is how the strings are
retrieved.
“string sEmpty = "";” is equivalent to “IL_0000: ldstr ""” // pushes a
string object for the metadata string token mdToken
“string sEmpty = string.Empty;” is equivalent to “IL_0000: ldsfld string
[mscorlib]System.String::Empty” // push the value of field on the stack
The important note here is: “The common language infrastructure (CLI)
guarantees that the results of two ldstr instructions referring to two
metadata tokens that have the same sequence of characters return
precisely the same string object (a process known as “string
interning”).”
So... the next question you might consider is: What's the performance
implication of “string interning?” I'm assuming it goes through some
kind of hash table to ensure that “the same sequence of characters
return precisely the same string object” which means that it's not
instantaneous.
According to Roman Batoukov “string interning” incurs some additional
cost. “Specifically, the memory used to store interned strings is not
freed until the AppDomain is shutdown, and extra time is required to
intern the string (even if the string is already interned).” Note that
this article refers to the .NET Compact Framework version 2.0 but I'm
sure the same “additional cost“ applies elsewhere.
Conclusion, if you care... use String.Empty.
The embedded links are in this post:
http://blog.radovici.com/eldar/archive/2005/08/19/2435.aspx