Answers for "replace space with hyphen javascript"

7

javascript replace spaces with dashes

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

replace all spaces with dash in javascript

title = title.replace(/\s/g , "-");
var html = "<div>" + title + "</div>";
// ...
Posted by: Guest on July-16-2020
-2

js replace all spaces

var replaced = str.replace(/ /g, '_');
Posted by: Guest on October-21-2020
0

replace space with hyphen/dash javascript

const str = "Sonic Free Games";
str = str.replace(/\s+/g, '-').toLowerCase();
console.log(str); // "sonic-free-games"
Posted by: Guest on August-09-2021
0

convert/replace space to dash/hyphen javascript

var str = "Sonic Free Games";
str = str.replace(/\s+/g, '-').toLowerCase();
console.log(str); // "sonic-free-games"
Posted by: Guest on August-09-2021

Code answers related to "replace space with hyphen javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language