/*** 用正则表达式将前后空格(包括占两个字符的中文空格);* BY YangZY* 2007-4-28*/String.prototype.trim = function() { return this.replace(/(^[/s/u3000]*)|([/s/u3000]*$)/g, "");} 说明: 其中/u3000为中文的空格;