我想用空格替換JavaScript字符串中的所有符號。 在此基礎上螺紋Fastest method to replace all instances of a character in a string和這個線程How to replace all dots in a string using JavaScript我做的:替換JavaScript中的所有加號符號字符串
soql = soql.replace(/+/g, " ");
但是,這給:
SyntaxError: invalid quantifier
任何想法,我該怎麼辦呢?
使用'/ \ ++/g'應該有助於提高性能 – Ian 2013-05-10 15:37:17