You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
480 B
18 lines
480 B
1 year ago
|
namespace StabilityMatrix.Core.Extensions;
|
||
|
|
||
|
public static class UriExtensions
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Return a new <see cref="Uri"/> with the given paths appended to the original.
|
||
|
/// </summary>
|
||
|
public static Uri Append(this Uri uri, params string[] paths)
|
||
|
{
|
||
|
return new Uri(
|
||
|
paths.Aggregate(
|
||
|
uri.AbsoluteUri,
|
||
|
(current, path) => $"{current.TrimEnd('/')}/{path.TrimStart('/')}"
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
}
|