📜  将替换空间转换为连字符 javascript 代码示例

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

代码示例2
var str = "Sonic Free Games";
str = str.replace(/\s+/g, '-').toLowerCase();
console.log(str); // "sonic-free-games"