static void Main(string[] args)
{
int[] intnum = { 1, 3, 5, 7, 9, 11, 8, 9, 1, 2 };
var lessthan10 = intnum.SkipWhile(x => x < 10);
Console.WriteLine("Numbers that are less than 10.");
foreach (var x in lessthan10)
{
Console.WriteLine(x);
}
Console.ReadKey();
}
The LINQ code above will produce the following result:

For more LINQ coding tips & tricks, subscribe now.
0 comments:
Post a Comment