You need to escape the .
because it has the meaning of “an arbitrary character” in a regular expression.
mystring = mystring.replace(/\./g,' ')
More Related Contents:
- How to replace all occurrences of a string in JavaScript
- How do I replace a character at a particular index in JavaScript?
- Replace multiple strings with multiple other strings
- Fastest method to replace all instances of a character in a string [duplicate]
- How to replace all occurrences of a string in JavaScript
- How can I remove a character from a string using JavaScript?
- Remove whitespace and line breaks between HTML elements using jQuery
- Case insensitive string replacement in JavaScript?
- How do I replace all occurrences of a string in JavaScript?
- Efficient Javascript String Replacement
- Insert space before capital letters
- JavaScript – Replace all commas in a string [duplicate]
- Reformat string containing date with Javascript
- `string.replace` doesn’t change the variable [duplicate]
- Replace spaces with dashes and make all letters lower-case
- Javascript – Replacing the escape character in a string literal
- JavaScript: replace last occurrence of text in a string
- Regular expression to get a string between two strings in Javascript
- Regular Expression to get a string between parentheses in Javascript
- How to create streams from string in Node.Js?
- How can I use jQuery to style /parts/ of all instances of a specific word?
- How can I insert new line/carriage returns into an element.textContent?
- How to trim a file extension from a String in JavaScript?
- What’s the point of new String(“x”) in JavaScript?
- How can I perform a str_replace in JavaScript, replacing text in JavaScript?
- JavaScript adding a string to a number
- What is the difference between ‘ and ” in JavaScript?
- Print / display a JavaScript variable’s name instead of it’s value
- How to count the number of lines of a string in javascript
- Does jQuery strip some html elements from a string when using .html()?