Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove %20 From the Url

Tags:

c#

I have a problem:

System.IO.Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath)

This statement gives %20 for me. I want to remove this. Is there any way other than replace?

like image 535
pinki Avatar asked Sep 16 '11 14:09

pinki


People also ask

What does the Remove URL page do?

This tool removes content only from Google Search. To clean up cruft, like old pages that 404. If you recently changed your site and now have some outdated URLs in the index, Google's crawlers will see this as we recrawl your URLs, and those pages will naturally drop out of our search results.

How do I remove URL from Google search bar?

How to Remove Past Link/URL from Google Chrome Address Bar. On the latest versions of Chrome, you can also use the keyboard to navigate to the URL/link to delete from the suggestion list, then click the “X” button that appears to the far right of the search bar next to the entry.


2 Answers

You can use HttpUtility.UrlDecode - see http://msdn.microsoft.com/en-us/library/system.web.httputility.urldecode.aspx

like image 195
Barry Kaye Avatar answered Oct 07 '22 13:10

Barry Kaye


You can use HTTPUtility.URLDecode to remove %20 and any other encoded characters. It won't actually remove it, but rather, replace it with a space, as that is what it represents. If you actually want it removed completely, you have to use replace.

like image 38
Kibbee Avatar answered Oct 07 '22 14:10

Kibbee