title: Strip trailing filename of a Url path
body: <p>I have a <code>Url</code> and I would like to get the path part but without the trailing file name. If the <code>Url</code> is <code>http://my.com/dir1/dir2/file.ext</code> then I would like to get <code>/dir1/dir2</code>.</p>
  
  <p>I've tried all kinds of splitting (<code>let parts = url.path().split("/");</code>, etc.) and gathering and joining and the code is horrible and looks inefficient.</p>