title: Return filename without extension from full path in C#
body: <p>I'm looking for a way to return fileName from full path but without extension. </p>
  
  <pre><code>    private static string ReturnFileNameWithoutExtension(string varFullPathToFile) {
          string fileName = new FileInfo(varFullPathToFile).Name;
          string extension = new FileInfo(varFullPathToFile).Extension;
          return fileName.Replace(extension, "");   
      }
  </code></pre>
  
  <p>Is there more bullet proof solution then replacing extension with empty string? </p>