title: Dealing with multiple '.' in a file extension
body: <p>I have this string that contains a <strong>filename</strong></p>
  
  <pre><code>string filename = "C:\\Users\\me\\Desktop\\filename.This.Is.An.Extension"
  </code></pre>
  
  <p>I tried using the conventional </p>
  
  <pre><code>string modifiedFileName = System.IO.Path.GetFileNameWithoutExtension(filename);
  </code></pre>
  
  <p>but it only gets me: </p>
  
  <pre><code>modifiedFileName = "C:\\Users\\me\\Desktop\\filename.This.Is.An"
  </code></pre>
  
  <p>In order for me to get <code>"C:\\Users\\me\\Desktop\\filename"</code> I would have to use <code>System.IO.Path.GetFileNameWithoutExtension</code> several times, and that's just not efficient. </p>
  
  <p>What better way is there to take my file name and have it return the <strong>directory</strong> + <strong>filename</strong> and no <em>exceptions</em>? </p>
  
  <p>Many thanks in advance!</p>