Haim Bender Haim Bender - 1 year ago 77
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 Source

I believe you're looking for HttpServerUtility.UrlEncode.

System.Web.HttpUtility.UrlEncode(string url)