Given an absolute URI/URL, I want to get a URI/URL which doesn\'t contain the leaf portion. For example: given http://foo.com/bar/baz.html, I should get http://foo.com/bar/.
Quick and dirty
int pos = uriString.LastIndexOf('/'); if (pos > 0) { uriString = uriString.Substring(0, pos); }