How to convert list of numbers to int 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 };
       
        int num = int.Parse(String.Join("", list.ToArray()));

        Console.Write(num);
    }
}



/*
run:
   
2418530
   
*/

 



answered Aug 4, 2023 by avibootz

Related questions

1 answer 147 views
147 views asked May 25, 2019 by avibootz
1 answer 178 views
1 answer 191 views
2 answers 142 views
1 answer 148 views
148 views asked Feb 12, 2016 by avibootz
1 answer 128 views
...