js去除字符串中的所有空格(包括前后,中间存在的所有空格)

js去除字符串中的所有空格:

obj.replace(/s/g,"");

感觉很好用。

原文地址:https://www.cnblogs.com/shaozhu520/p/10819581.html