title: Replace & with &amp; in C#
body: <p>Ok I feel really stupid asking this. I see plenty of other questions that resemble my question, but none seem to be able to answer it.</p>
  
  <p>I am creating an xml file for a program that is very picky about syntax. Sadly I am making the XML file from scratch. Meaning, I am placing each line in individually (lots of file.WriteLine(String)).</p>
  
  <p>I know this is ugly, but its the only way I can get the logic to work out.</p>
  
  <p>ANYWAY. I have a few strings that are coming through with '&amp;' in them.</p>
  
  <pre><code>if (value.Contains("&amp;"))
     {
        value.Replace("&amp;", "&amp;amp;");
     }
  </code></pre>
  
  <p>Does not seem to work. The value.Contains() seems to see it, but the replace does not work. I am using C# .Net 2.0 sp2. VS 2005.</p>
  
  <p>Please help me out here.. Its been a long week..</p>