Take and SelectMany

   
 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {
        string[] presidents = {"Aaa", "Art", "Buch", "Bushman", "Carter", "land"};

        IEnumerable<char> chars = presidents.Take(5).SelectMany(s => s.ToArray());

        foreach (char ch in chars)
            Console.WriteLine(ch);

    }
}

    


This entry was posted in LINQ. Bookmark the permalink.