title: Why can't I change the value of String.Empty?
body: <p>While I understand that changing the value of <code>String.Empty</code> would be a bad idea, I don't understand why I can't do it.</p>
  
  <p>To get what I mean, consider the following class:</p>
  
  <pre><code>public class SomeContext 
  { 
      static SomeContext(){}
      public static readonly string Green = "Green";
      public static readonly SomeContext Instance = new SomeContext();
  
      private SomeContext(){}
      public readonly string Blue = "Blue";
  
      public static void PrintValues()
      { 
          Console.WriteLine(new { Green, Instance.Blue, String.Empty }.ToString());
      }
  }
  </code></pre>
  
  <p>I have a little console app that tries to manipulate these three readonly fields.  It can successfully make Blue and Green into Pink, but Empty stays the same:</p>
  
  <pre><code>        SomeContext.PrintValues();
          ///  prints out : { Green = Green, Blue = Blue, Empty = }
          typeof(SomeContext).GetField("Blue").SetValue(SomeContext.Instance, "Pink");
          typeof(SomeContext).GetField("Green", BindingFlags.Public | BindingFlags.Static).SetValue(null, "Pink");
          typeof(String).GetField("Empty", BindingFlags.Public | BindingFlags.Static).SetValue(null, "Pink");
          SomeContext.PrintValues();
          ///  prints out : { Green = Pink, Blue = Pink, Empty = }
  </code></pre>
  
  <h2>Why?</h2>
  
  <p><em>Originally, I also asked why <code>String.Empty</code> wasn't a constant.  I found the answer to this part of my question <a href="https://stackoverflow.com/questions/507923/why-isnt-string-empty-a-constant">on another post</a> and deleted that part of the question).</em></p>
  
  <p><strong>Note: None of the "duplicates" have a conclusive answer to this problem, that's why I'm asking this question.</strong></p>