(1)var card = '6222 0236 0209 9812 331'; var card = card.replace(/\s/g, "");//正则去掉字符串中所有空格 alert(card);//输出 6222023602099812331
(2)String.trim()