I want to replace all the occurrences of a dot(.
) in a JavaScript string
For example, I have:
var mystring = 'okay.this.is.a.string';
I want to get: okay this is a string
.
So far I tried:
mystring.replace(/./g,' ')
but this ends up with all the string replaced to spaces.
I add double backslash to the dot to make it work. Cheer.
Example: I want to replace all double Quote (") into single Quote (') Then the code will be like this
One more solution which is easy to understand :)