Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

replace space with hyphen/dash javascript

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