title: How to manufacture an empty string in .NET?
body: <p>I have written a piece of optimized code that contains special cases for <code>null</code> and empty strings. I am now trying to write a unit test for this code. In order to do that, I need two empty (zero-length) string objects that are different objects. Like this:</p>
  
  <pre><code>string s1, s2;
  Assert.IsTrue(s1.Length == 0 &amp;&amp; s2.Length == 0);
  Assert.IsTrue(!ReferenceEquals(s1, s2));
  </code></pre>
  
  <p>It turns out that most .NET Framework APIs string are checking for an empty result. They are returning <code>string.Empty</code> in all those cases. For example, <code>"x".Remove(0, 1)</code> returns <code>string.Empty</code>.</p>
  
  <p>How can I create fresh zero-length string objects?</p>