How do I trim a string in JavaScript? That is, how do I remove all whitespace from the beginning and the end of the string in JavaScript?
I have a lib that uses trim. so solved it by using the following code.
String.prototype.trim = String.prototype.trim || function(){ return jQuery.trim(this); };