Equivalent for $.trim in Javascript?
<pre><code>$.trim(value);
</code></pre>

<p>The above jquery code would trim the text. I need to trim the string using Javascript.</p>

<p>I tried:</p>

<pre><code>link_content = "    check    ";
trim_check = link_content.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g,'');
</code></pre>

<p>How to use trim in javascript? Equivalent of <code>$.trim()</code> of jQuery?</p>
