C# 字符串转换问题

在 .NET Core 中如何简单高效地完成下面的字符串转换?

var originRedirectUri = "https://q.cnblogs.com/account/signin?ReturnUrl=%2F";

转换为

var redirectUri = "https://passport.cnblogs.com/account/signin?ReturnUrl=https%3A%2F%2Fq.cnblogs.com%2F`";


慕码人2483693
浏览 245回答 1
1回答

侃侃尔雅

UriBuilder u = new UriBuilder("url");var q = System.Web.HttpUtility.ParseQueryString(u.Query);q["ReturnUrl"] = "url";u.Query = q.ToString();var url = u.ToString();
打开App,查看更多内容
随时随地看视频慕课网APP