js 怎么去除所有空格自带了trim方法:$.trim("abc ")得到abc自己写函数:function trim(str) {return str.replace((^s+)|(s+$)g, ""2023-04-06JavaScript270