title: Delete Doc files and keep Docx files
body: <p>I'm trying to delete <code>.doc</code> files in a folder that also contains <code>.docx</code> files too.</p>
  
  <p>This is my attempt so far:</p>
  
  <pre><code>string[] files = Directory.GetFiles(Path, "*.doc", SearchOption.AllDirectories);
  
  foreach (string f in files)
  {
      File.Delete(f);
  }
  </code></pre>
  
  <p>It deletes word documents with extensions of <code>.doc</code> and <code>.docx</code>.
  I want to delete <code>.doc</code> files only and keep <code>.docx</code> files.</p>