Skip by index and value length in CSharp

Description

The following code shows how to skip by index and value length.

Example


/*w w  w. j a va2  s.co  m*/
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {
        string[] presidents = {"Ant", "Maven", "NuGet", "Dll", "Jar", "Java"};
        IEnumerable<string> items = presidents.SkipWhile((s, i) => s.Length > 4 && i < 10);
        foreach (string item in items)
            Console.WriteLine(item);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    LINQ »




Operator
Select
Where
OrderBy
Group
Join
Let
LINQ