}

Trim Index Page 1

How to Trim String in JavaScript ?

With javascript if you need to remove the spaces on left and right you can use trim. If you need to trim only the left side of the string use replace with a regex, ex: str.replace(/^s+/,'');. Check this article for more details