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

Haim Bender picture Haim Bender · Oct 5, 2009 · Viewed 112.4k times · Source

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

Answer

Dirk Vollmar picture Dirk Vollmar · Oct 5, 2009

Another way of doing this is using Uri.EscapeUriString(stringToEscape).