js去空格函数
分别去字符串前后,左边,右边空格
String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g,"")} 本文出自 51CTO.COM技术博客String.prototype.ltrim = function(){ return this.replace(/^\s+/g,"")} String.prototype.rtrim = function(){ return this.replace(/\s+$/g,"")} |


xieyu
博客统计信息
热门文章
最新评论
友情链接

