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 : js replace space with dash
Answered by : vastemonde
// replaces space with '-'
str = str.replace(/ /g, "-");
// or
str = str.split(' ').join('-');
Source : | Last Update : Tue, 18 May 21
Question : javascript replace all spaces with dashes
Answered by : vmxes
let originalText = 'This is my text';
let dashedText = originalText.replace(/ /g, '-');
Source : https://javascriptf1.com/snippet/replace-spaces-with-dashes-in-javascript | Last Update : Fri, 11 Dec 20
Question : replace all spaces with dash in javascript
Answered by : horrible-hamster-top8s9dfumiw
title = title.replace(/\s/g , "-");
var html = "<div>" + title + "</div>";
// ...
Source : https://stackoverflow.com/questions/2657433/replace-space-with-dash-javascript/2657438#:~:text=var%20html%20%3D%20%22,%3Ca%20href%3D%22go. | Last Update : Thu, 23 Jul 20
Question : replace spaces with dashes
Answered by : worried-wasp-iuuql7o56gxl
const text = "codetogo saved me tons of time";
text.replace(/ /g, "-");
Source : https://codetogo.io/ | Last Update : Wed, 27 Oct 21