Answers for "replace space with dash jquery"

3

js replace space with dash

// replaces space with '-'
str = str.replace(/ /g, "-");
// or
str = str.split(' ').join('-');
Posted by: Guest on May-11-2021
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
0

javascript replace dash with space

let str = "This-is-a-news-item-";
str = str.replace(/-/g, ' ');
alert(str);
Posted by: Guest on August-19-2020

Code answers related to "replace space with dash jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language