JS 去掉两边空格字符串

        function trim(str) {
        return str.replace(/(^\s*)|(\s*$)/g,"");
        }

原文地址:https://www.cnblogs.com/mbtq/p/2881380.html