trim
NAME
String.trim
FUNCTION
The Javascript function trim removes leading and trailing
spaces from a string.
EXAMPLE
Example usage:
var x = ' abc ';
var y = x.trim(); // returns 'abc'
SOURCE
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}