Skip to content

Instantly share code, notes, and snippets.

@davidvesely
Created July 22, 2017 19:26
Show Gist options
  • Save davidvesely/b92ece904888512f3c9c51ce75c86a91 to your computer and use it in GitHub Desktop.
Save davidvesely/b92ece904888512f3c9c51ce75c86a91 to your computer and use it in GitHub Desktop.
Uri Append extension method
public static Uri Append(this Uri uri, params string[] paths)
{
return new Uri(paths.Aggregate(uri.AbsoluteUri,
(current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/'))));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment