String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}/*
sample:
var s=" abc  ";
var st=s.trim();
//st="abc";*/