1. StringBuilder 와 insert를 이용하여
public class main
{
public static String addComma(String number){
StringBuilder sb = new StringBuilder(number);
int numberLength = number.length();
int commaCount = ( numberLength -1 ) /3;
for(int i = 0, k=1; i < commaCount; i++){
sb.insert(numberLength - 3 * k , ",");
k++;
}
return sb.toString();
}
public static void main(String[] args)
{
String num= "10000000000";
num = addComma(num);
System.out.println(num);
}
}