[Solved] Loop to write a cimma separated list of items [closed]


Just check where you are in your loop to know if you need to print the comma.

        public static void Test()
        {
            for (int i = 49; i >= 1; i--)
            {
                Console.WriteLine(i + (i != 1 ? "," : ""));
            }

            Console.ReadLine();
        }

solved Loop to write a cimma separated list of items [closed]