util.js

来源:互联网 发布:linux镜像文件下载 编辑:程序博客网 时间:2024/05/21 19:23

//去左右空格

String.prototype.trim = function(){
 return this.replace(/(^s*)|(s*$)/g, "");
}
String.prototype.lTrim = function(){
 return this.replace(/(^s*)/g, "");
}
String.prototype.rtrim = function(){
 return this.replace(/(s*$)/g, "");
}