Trim a string from end or start
<p>I have a String in JavaScript. Say <code>var val = %Hello;</code> or sometimes <code>var val = Hello%;</code> I need to trim '%' from the String to get <code>Hello</code>. How to do this in javascript?</p>
