Asked
Viewed
139 times
How can I replace multiple (++++++) signs with blank space?
Example: var string = "+++++++++++++++++";
asked Aug 9, 2017 at 7:32
0
var string = "+++++++++++++++++";
string = string.replace(/\+*/g, '');
console.log(string.length);
answered Aug 9, 2017 at 7:33
marvel308
10.5k33 gold badges2424 silver badges3232 bronze badges
Hello there, I tried your code, the snippet you presented seems to work just fine. I am indeed grateful for your help!
const str = 'abc++++++def++++frberbf++fsvsf';
const newstr = str.replace(/(.)\+{2,}/g, ' ');
console.log(newstr);
answered Aug 9, 2017 at 7:38
kevguy
4,43811 gold badge2727 silver badges4747 bronze badges
Start asking to get answers
Find the answer to your question by asking.
Ask question
Explore related questions
See similar questions with these tags.