简体   繁体   中英

Remove multiplication symbol (×) from URL

Below is a URL in which multiplication symbol × is coming. It is not 'x'. I checked for its ascii value but was not able to find it. I only got how to create it (alt+158).
URL:
http://localhost:6000/SearchService/SearchService.svc/GetSearchResults?srchKeyword=test×projectId=2&user=3
I am creating this url in javascript. I tried replacing %C3%97 with empty string but it didn't worked. Kindly tell me how to remove it as i am getting incorrect result.

You can simply replace this character using String.prototype.replace :

 var url = "http://localhost:6000/SearchService/SearchService.svc/GetSearchResults?srchKeyword=test×projectId=2&user=3"; document.body.innerHTML += "<p>" + url + "</p>"; url = url.replace('×', ''); document.body.innerHTML += "<p>" + url + "</p>";

At the same time, it is a good idea to understand the reason of appearance of this character instead of handling the consequences.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM