String strip() for JavaScript?

Viewed 344576

How do I strip leading and trailing spaces from a string?

For example, " dog " should become "dog".

8 Answers
Related