title: How to remove all text in .txt before writing C#
body: <p>How to remove everything from text file before writing?</p>
  
  <pre><code>System.IO.File.AppendAllText(@"D:\text.txt", Environment.NewLine + item);
  </code></pre>
  
  <p>This is how I am writing to it.</p>