会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
dqg0312
博客园
首页
新随笔
联系
管理
订阅
js常用代码
给js的String添加trim方法
String.prototype.trim = function() {
//return this.replace(/[(^\s+)(\s+$)]/g,"");//會把字符串中間的空白符也去掉
//return this.replace(/^\s+|\s+$/g,""); //
return
this
.replace(/^\s+/g,
""
).replace(/\s+$/g,
""
);
}
posted on
2011-03-01 16:45
%小Y%
阅读(
248
) 评论(
3
)
收藏
举报
刷新页面
返回顶部
公告