js去掉字符串前后空格符

来源:互联网 发布:mac mail qq邮箱 编辑:程序博客网 时间:2024/05/21 06:00
 Using   Regular   Expressions   (JavaScript   1.2/JScript   4+)   :  
   
  String.prototype.LTrim=new   Function("return   this.replace(/^//s+/,'')")  
  String.prototype.RTrim=new   Function("return   this.replace(///s+$/,'')")  
  String.prototype.Trim=  
  new   Function("return   this.replace(/^//s+¦//s+$/,'')")  
 
原创粉丝点击