Avoid printing the last comma

前端 未结 13 522
无人及你
无人及你 2020-12-03 14:58

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

相关标签:
13条回答
  • 2020-12-03 15:51

    Try this

    public static void atob(int a,int b)
    {
        for(int i = a; i < b; i++) 
        {
                System.out.print(i + ",");
        }
        System.out.print(b); 
    }
    
    0 讨论(0)
提交回复
热议问题