sunlanda
9/12/2016 - 1:24 PM

trim

trim

function trim2(str){
    var reg =  /(^\s*)|(\s*$)|(\s+)/g;
    str =str.replace(reg,"")
    return str;
}