title: Remove string after last slash in JAVA
body: <p>I have a problem with removing everything after the last slash of URL in JAVA
  For instance, I have URL:</p>
  
  <pre><code>http://stackoverflow.com/questions/ask
  </code></pre>
  
  <p>n' I wanna change it to:</p>
  
  <pre><code>http://stackoverflow.com/questions/
  </code></pre>
  
  <p>How can I do it.</p>