Created
July 22, 2017 19:26
-
-
Save davidvesely/b92ece904888512f3c9c51ce75c86a91 to your computer and use it in GitHub Desktop.
Uri Append extension method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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