Can someone help me on how to remove spaces in JavaScript. I want to keep leading spaces as is and remove only spaces.
EG: ' test 'becoming ' test'. It seems to be pretty simple, but I can't figure it out.
PS: I’m pretty sure that I can’t be the first to ask about this, but I can’t find the answer in SO. Also, I am looking for a solution for JavaScript. I do not use jQuery.
user1 source
share