标签:java io for ar cti amp sp on javascript
function formatCardNo(cardNo){
var result = [],len = cardNo.length;
var j = 0;
for(var i = 0 ; i < len;i++){
if(cardNo[i] == " "){
continue;
}
j++;
result.push(cardNo[i]);
if(j % 4 ==0 && i != len-1){
result.push(" ")
}
}
return result.join("");
}
标签:java io for ar cti amp sp on javascript
原文地址:http://www.cnblogs.com/lglijing/p/3937967.html