Reputation: 19651
var text = "'Hello'World'''";
how to replace all '
and Hello
and World
to '
result = "'''''''"
Upvotes: 1
Views: 629
Reputation: 13471
text.replace(/'|Hello|World/g, "'")
The g
is for global, it wont stop at the first match but continue matching as many times as possible.
Upvotes: 4