1 Answer
  • 1
name Punditsdkoslkdosdkoskdo

Path.Combine for URLs in path?

Path.Combine is handy, but is there a similar function in the .NET framework for URLs?

I'm looking for syntax like this:

Url.Combine("", "/Images/Image.jpg")

which would return:


  • 1

Uri has a constructor that should do this for you: new Uri(Uri baseUri, string relativeUri)

Here's an example:

Uri baseUri = new Uri("");
Uri myUri = new Uri(baseUri, "catalog/shownew.htm");
  • 1
Reply Report

Related Questions

Trending Tags