title: trim end of the string in javascript
body: <p>I want to trim empty string from end of the string.
  For example; txtSearch value is 'test      ' How to replace it 'test'?</p>
  
  <pre><code>&lt;asp:TextBox runat="server" ID="txtSearch" onKeyDown="return search_onKeyDown(event);" onKeyUp="search_onKeyUp(event);"
  </code></pre>