去掉字符串前后所有空格

function Trim(str)
{
return str.replace(/(^\s*)|(\s*$)/g, "");
}