function _trim(string) {
return string.replace(/^\s
((?:[\S\s]
\S)?)\s
1');
string.replace(/^\s
((?:[\S\s]
\S)?)\s
1') 去除参数字符串两端的空格并返回
字符串 stringObject.replace(regexp/substr,replacement) 方法执行的是查找并替换的操作
regexp/substr : 子字符串或要替换的模式的 RegExp 对象
replacement : 一个字符串值。规定了替换文本或生成替换文本的函数。
/^\s
((?:[\S\s]
\S)?)\s
匹配输入字符串的结束位置
\s 匹配所有空白符,包括换行
\S 匹配任何非空白字符
* 匹配前面的子表达式零次或多次。例如,zo* 能匹配 "z" 以及 "zoo"。* 等价于{0,}
? 匹配前面的子表达式零次或一次。例如,"do(es)?" 可以匹配 "do" 或 "does" 。? 等价于 {0,1}。