Answers for "javascript replace spac e with dash"

7

javascript replace spaces with dashes

title = title.replace(/\s/g , "-");
Posted by: Guest on August-24-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 "javascript replace spac e with dash"

Code answers related to "Javascript"

Browse Popular Code Answers by Language