Cleanly combines URL segments in .NET with proper slash, query, and anchor handling.
$ dotnet add package AG.UrlHelpersAG.UrlHelpers is a minimal, cross-platform URL composition utility library that simplifies combining and normalizing URL segments in .NET applications.
dotnet add package AG.UrlHelpers
or via .csproj
<PackageReference Include="AG.UrlHelpers" Version="1.0.0" />
using AG.UrlHelpers;
string url = UrlPath.Combine(
"https://example.com/",
"api/",
"/v1/",
"resource?type=json#top"
);
// Result: https://example.com/api/v1/resource?type=json#top