js常用代码
时间:2011-03-01 来源:^^小Y
- String.prototype.trim = function() {
- //return this.replace(/[(^\s+)(\s+$)]/g,"");//會把字符串中間的空白符也去掉
- //return this.replace(/^\s+|\s+$/g,""); //
- return this.replace(/^\s+/g,"").replace(/\s+$/g,"");
- }
相关阅读 更多 +
时间:2011-03-01 来源:^^小Y