July 15, 2008
ReplaceAll in Javascript
Nikolai Kordulla
0 comments >>
In javascript you only have replace. If you want to use replaceall just do this.
string.replace(/\W+/g, '-');The g stands for ReplaceAll. So in this case all non word characters will be replaced with '-'.