这样就可以了:
xx=xx..replace(/(^\s*)|(\s*$)/g,"");
另:
去左空格replace(/(^\s*)/g, "");
去右空格replace(/(\s*$)/g, "");
中文全角空格不可以
这样就可以了:
xx=xx..replace(/(^\s*)|(\s*$)/g,"");
另:
去左空格replace(/(^\s*)/g, "");
去右空格replace(/(\s*$)/g, "");
中文全角空格不可以
转载于:https://www.cnblogs.com/-gap/archive/2012/08/18/2645623.html