title: How do I trim a file extension from a String in Java?
body: <p>What's the most efficient way to trim the suffix in Java, like this:</p>
  
  <pre><code>title part1.txt
  title part2.html
  =&gt;
  title part1
  title part2
  </code></pre>