How to replace all dots in a string using JavaScript

You need to escape the . because it has the meaning of “an arbitrary character” in a regular expression.

mystring = mystring.replace(/\./g,' ')

Leave a Comment