QUOTE(tk=lm2408 @ Feb 8 2017, 06:05 AM)
All of them if possible.
Good, because that's much easier.
You can use string replace(). I don't usually link to w3schools, but it was the most understandable page I found now.
http://www.w3schools.com/jsref/jsref_replace.aspCODE
document.write(decodeURIComponent(dir).replace(/\//g, 'X'));
I used X as the replacement character. You can use what you want or nothing within the quotes. As you can read at the linked to page the global flag can only be used with regex, hence the first parameter looks as it does. If it had been a normal letter, for example 'a', that should be replaced it would have looked like this.
CODE
replace(/a/g, 'X')
But the slash needs to be escaped with a backslash. Just substituting the first instance of a word or letter is really straightforward, no regex needed.