日期:2014-05-16 浏览次数:20384 次
//去除空格 String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } “测试 ”.Trim();
?
数组去重 var arr=["a","b","c","a","ba","bc"]; alert(arr.join(",").match( /([^,]+)(?!.*,\1(,|$))/ig));