Do Except operation on results from Take in CSharp
Description
The following code shows how to do Except operation on results from Take.
Example
/* w w w . j a v a 2 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 = {"Groovy", "HTML", "apple", "HTML5", "CSS", "Css3"};
IEnumerable<string> processed = presidents.Take(4);
IEnumerable<string> exceptions = presidents.Except(processed);
foreach (string name in exceptions)
Console.WriteLine(name);
}
}
The code above generates the following result.