Calling the ToList Operator : ToList « LINQ « C# / CSharp Tutorial






using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass {
    public static void Main() {
        string[] presidents = {"G", "H", "a", "H", "over", "Jack"};
        List<string> names = presidents.ToList();
        foreach (string name in names)
            Console.WriteLine(name);
    }
}








22.23.ToList
22.23.1.Calling the ToList Operator
22.23.2.Convert Query result to a List
22.23.3.Convert an ArrayList to an IEnumerable That Can Be Used with the Typical Standard Query Operators
22.23.4.calling ToList.