|
|
|
|
|
by club7g
4530 days ago
|
|
I don't mean to be pedantic; well actually I do. The spacify solution is incorrect as the sample suggests that a blank space is not replaced with 2 blank spaces. A correct solution would be: function spacify(input) {
return input.replace(/([^ ])/g, '$1 ');
} |
|
Additionally, you could also use,
to remove the additional space.