js 字符串去空格

str=str.replace(/\t+/g,"").replace(/\n+/g,"").replace(/\r+/g,"").replace(/\s+/g,"");

够了,多余的可能画蛇添足

posted @ 2012-02-08 18:42  xngeer  阅读(172)  评论(1编辑  收藏  举报