JS过滤空格

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

   str = $.trim(str)

2、过滤所有空格

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

原文地址:https://www.cnblogs.com/mofish/p/2459337.html