Concat results returned from Take and Skip in CSharp
Description
The following code shows how to concat results returned from Take and Skip.
Example
// www. ja v a2 s .c o m
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
public static void Main() {
string[] presidents = {"ant", "arding", "arrison", "eyes", "over", "ackson"};
IEnumerable<string> items = presidents.Take(5).Concat(presidents.Skip(5));
foreach (string item in items)
Console.WriteLine(item);
}
}
The code above generates the following result.