Haim Bender Haim Bender - 2 months ago 11
C# Question

How do I replace all the spaces with %20 in C#

I want to make a string into a URL using C#, there must be something in the .NET framework that should help, right?.

Answer

I believe you're looking for HttpServerUtility.UrlEncode.

System.Web.HttpUtility.UrlEncode(string url)