Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript replace space with minus

// replaces space with '-'
str = str.replace(/ /g, "-");
// or
str = str.split(' ').join('-');
 
PREVIOUS NEXT
Tagged: #javascript #replace #space
ADD COMMENT
Topic
Name
5+2 =