title: Split string of folder path
body: <p>If I have a file path such as:</p>
  
  <pre><code>var/www/parent/folder
  </code></pre>
  
  <p>How would I go about removing the last folder to return:</p>
  
  <pre><code>var/www/parent
  </code></pre>
  
  <p>The folders could have any names, I'm quite happy using regex.</p>
  
  <p>Thanks in advance.</p>