title = title.replace(/\s/g , "-");
let originalText = 'This is my text'; let dashedText = originalText.replace(/ /g, '-');
title = title.replace(/\s/g , "-"); var html = "<div>" + title + "</div>"; // ...
const name = 'Hi my name is Flavio' name.replace(/\s/g, '') //HimynameisFlavio
var replaced = str.replace(/ /g, '_');
str = str.replace(/\s/g, " ");
str = str.replace(/\s/g, "<br>");