JS过滤空格

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

   str = $.trim(str)

2、过滤所有空格

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

posted @ 2012-04-20 14:57  沫鱼  阅读(18423)  评论(1编辑  收藏  举报