title: How to split filesystem path in Java?
body: <p>If I have a string variable inside one class</p>
  
  <pre><code>MainActivity.selectedFilePath
  </code></pre>
  
  <p>which has a value like this</p>
  
  <pre><code>/sdcard/images/mr.32.png
  </code></pre>
  
  <p>and I want to print somewhere only the path up to that folder without the filename</p>
  
  <pre><code>/sdcard/images/
  </code></pre>