title: best way to remove file extension
body: <p>What is the shortest way to remove file extension? this is what I have tried:</p>
  
  <pre><code>file = "/home/usr/my_file.xml"
  file = File.basename(file)
  file.slice! File.extname(file)   #=&gt; my_file
  </code></pre>