I want to replace all the occurrences of a dot( .
) in a JavaScript string(我想替换JavaScript字符串中所有出现的dot( .
))
For example, I have:(例如,我有:)
var mystring = 'okay.this.is.a.string';
I want to get: okay this is a string
.(我想得到: okay this is a string
。)
So far I tried:(到目前为止,我尝试了:)
mystring.replace(/./g,' ')
but this ends up with all the string replaced to spaces.(但这最终将所有字符串替换为空格。)
ask by Omar Abid translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…