Extract base url from full url
<p>Any quick way to extract base url from full url? for e.g., if i have <a href="http://test.example.com/abcd/test.html" rel="nofollow">http://test.example.com/abcd/test.html</a> - i want only <a href="http://test.example.com" rel="nofollow">http://test.example.com</a>. </p>

<p>I can always do string parsing - but wanted to know if there is something in Uri where I can get it directly.  </p>
