Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript replace all spaces with dashes

let originalText = 'This is my text';
let dashedText = originalText.replace(/ /g, '-');
Source by javascriptf1.com #
 
PREVIOUS NEXT
Tagged: #javascript #replace #spaces #dashes
ADD COMMENT
Topic
Name
3+3 =