Replace Spaces With Backslash Js

[Solved] Replace Spaces With Backslash Js | Php - Code Explorer | yomemimo.com
Question : javascript replace spaces with dashes

Answered by : strange-sloth-3xtkvm5llvi5

title = title.replace(/\s/g , "-");

Source : https://stackoverflow.com/questions/2657433/replace-space-with-dash-javascript/2657438 | Last Update : Mon, 31 Aug 20

Question : replace spaces with backslash js

Answered by : parotay

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

Source : | Last Update : Tue, 26 Jan 21

Answers related to replace spaces with backslash js

Code Explorer Popular Question For Php