方法一.正则

var str="str 132 ff";
var re=/\s/g;
alert(str.replace(re,""));

 

posted on 2015-01-25 15:04  鬼畜十三  阅读(176)  评论(0编辑  收藏  举报