I have URLs as follows.
http://mysite.company.com/webApp1/site1/Pages/default.aspx
https://mysite2.company.com/webAppTwo/Site2/Pages/sub/home.aspx
http://mysiteThree.company.com/application/siteThree/SitePages/
I need a function which can retrieve substring from the above URLs. The substring should be upto the 2nd occurence of ‘/’ as follows.
http://mysite.company.com/webApp1/site1/
https://mysite2.company.com/webAppTwo/Site2/
http://mysiteThree.company.com/application/siteThree/
Thanks.