JavaScript: trim() Function

Posted by Randika on February 09, 2010

Where is the trim() function to remove leading and trailing whitespaces of strings? Actually Javascript String object doesn’t natively support it. But there is a workaround for this with regular expressions.