Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert space to dash/hyphen javascript regex

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