I'm trying to print this loop without the last comma. I've been Googling about this and from what i've seen everything seems overcomplex for such a small problem. Surely there is an easy solution to avoid printing the last comma. Much appreciated if somebody could help me out, this is driving me insane!!!
For example it loops from 1-10 // 1,2,3,4,5,6,7,8,9,10, < do not want this last comma
public static void atob(int a,int b)
{
for(int i = a; i <= + b; i++)
{
System.out.print(i + ",");
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…