- var str = "";
- var str0 = String.Empty;
we can easily find out that str = str0; but which way is faster?
the following is the disassembly from the first statement:
the following is the one from the second statement:
It does not tell much, but when we actually run it using StopWatch, we can find the String.Empty is 5-6 times faster than empty string. I would not say the different is so huge because maybe it is my computer's configuration, but definitely the second statement is faster.