How to convert list of numbers to string in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

class Program
{
    static void Main() {
        List<int> list = new List<int>() { 2, 4, 18, 530 };
       
        string str = string.Join(" ", list.ToArray());

        Console.Write(str);
    }
}



/*
run:
   
2 4 18 530
   
*/

 



answered Aug 4, 2023 by avibootz
...