JavaScript中Trim(),TrimStart(),TrimEnd()的实现
<br />//去除字符串头尾空格或指定字符String.prototype.Trim= function(c){ if(c==null||c=="") { var str= this.replace(/^/s*/, ''); var rg = //s/; var i = str.length; while (rg.test(str.charAt(--i))); return str.sli
原创
2011-03-31 17:18:00 ·
16429 阅读 ·
0 评论