Replace all spaces in a string with ‘+’

Here’s an alternative that doesn’t require regex:

var str = 'a b c';
var replaced = str.split(' ').join('+');

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)