正文开始
https://www.cnblogs.com/taoshihan/p/16793319.html
function trim(str, char) { if (char) { str=str.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); } return str.replace(/^\s+|\s+$/g, ''); };
正文结束