To replace dash (-) with a space in a string in JavaScript, you can use the .replace()
method of the string object with a regular expression.
index.tsx179 chars5 lines
In this code, the regular expression /-/g
matches all instances of the dash character globally throughout the string, and replaces them with a space ' '
.
gistlibby LogSnag