js 去除字符串所有空格

function trim(str){
    return str.replace(/\s|\xA0/g,"");    
}

 

posted @ 2017-03-09 11:13  b̶i̶n̶g̶.̶  阅读(5102)  评论(1编辑  收藏  举报