I have a string that contains a url which looks like this:
http://www.test.com/images/tony's pics.jpg
I need the url to look like this:
http://www.test.com/images/tony%27s%20pics.jpg
How would I programmatically solve this with a url in a STRING form. Thanks.
I would think this would easily be solved by using the HttpUtility UrlEncode:
string url = "http://www.test.com/images/" + HttpUtility.UrlEncode("tony's pics.jpg");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With