标签:java io ar cti div javascript log c
var str = ‘123456789‘;
function division(str){
var arr = str.split(‘‘),
len = arr.length,
i = 3;
while(i < len){
arr.splice(len-i,0,‘,‘);
i+=3;
}
return arr.join(‘‘);
}
console.log(division(str)); //123,456,789
有什么错误的地方,欢迎大家积极拍砖!
标签:java io ar cti div javascript log c
原文地址:http://www.cnblogs.com/fengzekun/p/3891909.html