Combine SequenceEqual Operator with Take and Count in CSharp

Description

The following code shows how to combine SequenceEqual Operator with Take and Count.

Example


using System;/* w w w . j  a  v  a  2s . c om*/
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"};

        bool eq = presidents.SequenceEqual(presidents.Take(presidents.Count()));
        Console.WriteLine(eq);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    LINQ »




Operator
Select
Where
OrderBy
Group
Join
Let
LINQ