关于IE下不支持js的trim()方法的解决方案 cline · 2012-08-13 10:52 · javascript · 编程语言 · Markdown str = str.replace(/^\s+|\s+$/g,''); 原理是利用正则表达式进行替换操作。。。