Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Array to List

using System;
using System.Collections.Generic;
using System.Linq;
 
public class Example
{
    public static void Main()
    {
        int[] array = { 1, 2, 3, 4, 5 };
        List<int> list = array.ToList();
 
        // List<int> list = array.OfType<int>().ToList();
        // List<int> list = array.Cast<int>().ToList();
 
        Console.WriteLine(String.Join(",", list));
 
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Array #List
ADD COMMENT
Topic
Name
8+5 =