title: C#: Need to remove last folder from file name path
body: <p>I'm pulling a file path from a database to use as a file source.
  I need to remove the last folder from the source path, so I can then create new folders to use as the destination path.</p>
  
  <p>Example source file path:
  <code>\\\\ServerName\\Documents\\MasterDocumentFolder\\</code></p>
  
  <p>I need to remove the last folder from that string and get this:
  <code>\\\\ServerName\\Documents\\</code></p>
  
  <p>So I can create a folder like this:
  <code>\\\\ServerName\\Documents\\NewDocumentFolder1\\</code></p>
  
  <p>Edit: I have updated my example paths to show why the Path.GetDirectoryName() won't work in this case.</p>