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 135 views
135 views asked May 25, 2019 by avibootz
1 answer 171 views
1 answer 184 views
2 answers 131 views
1 answer 141 views
141 views asked Feb 12, 2016 by avibootz
1 answer 117 views
...