I want to replace all whitespaces except the first and the last one as this image.
How to replace only the red ones?
I tried :
.replace(/\s/g, "_");
but it captures all spaces.
I want to replace all whitespaces except the first and the last one as this image.
How to replace only the red ones?
I tried :
.replace(/\s/g, "_");
but it captures all spaces.