Is there a way to replace every \"%20\" with a space using JavaScript. I know how to replace a single \"%20\" with a space but how do I replace all of them?
Use the global flag in regexp:
global
var replaced = str.replace(/%20/g, " "); ^