I want to replace . with a space in the string, but I can't.
For example,
var mystring = 'okay.this.is.a.string';
If there is, I want to change this to okay this is a string
but I used a regular expression
mystring.replace(/./g), ')
All strings are blank.
What's the problem?
In the regular expression, . is interpreted as any character
mystring.replace(/\./g,' ')
If you change it like this, it'll work out.
© 2024 OneMinuteCode. All rights reserved.