On Mon, 25 Aug 2008 09:46:14 -0700, Mythran <My*****@commun ity.nospam>
wrote:
Empty is a readonly member variable of the String class which is set in
String's default constructor as an empty string literal (IE: ""). But,
just because it is a member variable does NOT mean it isn't treated
differently by the compiler and compiled into more efficient code
depending on how it's called.
In particular, because it's an interned string in a shared DLL (that is, a
DLL that can be shared across multiple processes), there is a potential
tiny savings if one uses _only_ String.Empty, in that the process won't
have to allocate that one extra emtpy string.
If you've got even one "" in your code somewhere though, that would negate
any benefit. And in any case, it's certainly not worth worrying about.
Pete