📜  用反斜杠替换空格 js - Javascript 代码示例

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

代码示例2
input = "Hello my name is Luke"
inputWithoutSpaces = input.replace(/\s/g, "_"); // \s == space
console.log(inputWithoutSpaces); //Output: "Hello_my_name_is_Luke"