📌  相关文章
📜  site:stackoverflow.com javascript 用单个空格替换多个空格 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:02.136000             🧑  作者: Mango

代码示例1
var multiSpacesString="I  have     some big    spaces.";
var singleSpacesString=multiSpacesString.replace(/  +/g, ' ');//"I have some big spaces."