JS过滤空格

1、过滤字符串两边的空格

   str = $.trim(str)

2、过滤所有空格

   str = str.replace(/ /g,'')

posted @   沫鱼  阅读(18435)  评论(1编辑  收藏  举报
点击右上角即可分享
微信分享提示