DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
js replace space with dash
// replaces space with '-'
str
=
str
.
replace
(
/
/
g
,
"-"
)
;
// or
str
=
str
.
split
(
' '
)
.
join
(
'-'
)
;
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#js
#replace
#space
#dash
ADD COMMENT
Topic
COMMENT
Name
4+1 =
Submit