Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert/replace space to dash/hyphen javascript

var str = "Sonic Free Games";
str = str.replace(/s+/g, '-').toLowerCase();
console.log(str); // "sonic-free-games"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #space #javascript
ADD COMMENT
Topic
Name
2+5 =