Answers for "replace spaces with backslash js"

7

javascript replace spaces with dashes

title = title.replace(/\s/g , "-");
Posted by: Guest on August-24-2020
0

replace spaces with backslash js

input = "Hello my name is Luke"
inputWithoutSpaces = input.replace(/\s/g, "_"); // \s == space
console.log(inputWithoutSpaces); //Output: "Hello_my_name_is_Luke"
Posted by: Guest on January-19-2021

Code answers related to "replace spaces with backslash js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language