title: Clear file before writing in it StreamWriter (c#)
body: <p>I using stream writer to write generated code to file</p>
  
  <p>Here is code</p>
  
  <pre><code>using (StreamWriter writer = File.AppendText("generated-codes.txt"))
          {
              foreach (String s in passwords)
                  writer.WriteLine(s);
          }
  </code></pre>
  
  <p>How I can clear file before writing to it.</p>
  
  <p>Application is .NET Core 2.1 solution</p>