场景:字符串前后空格去除,微信小程序发现没有trim函数 function trimStr(str: string) { return str.replace(/(^\s*)|(\s*$)/g, ""); }