jQuery – replace all instances of a character in a string [duplicate]

This does not work and I need it badly

$('some+multi+word+string').replace('+', ' ' );

always gets

some multi+word+string

it’s always replacing for the first instance only, but I need it to work for all + symbols.

3 Answers
3

Leave a Comment