I am trying to replace all spaces inside a string with a hyphen. I tried this:
h3Text.replace(/\s/, '-');
But it replaces only the first copy of the space, and not the one after it. What is a regular expression so that it replaces ALL empty spaces?
source
share