js 去掉 空格

来源:互联网 发布:不亦说乎 编辑:程序博客网 时间:2024/06/05 00:38
 <!--
//
Trim() , Ltrim() , RTrim()
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,"");
}
//-->
原创粉丝点击