Reputation: 7532
my code now only replaces the first -
with space, but there are multiple -
in the url, how do I replace all with space?
window.location.hash.substring(1).replace('-', ' ');
Upvotes: 1
Views: 92
Reputation: 2008
Try:
window.location.hash.substring(1).replace(/-/g, ' ')
g -> all instances
Upvotes: 3