Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

I am Jalpesh Vadgama a Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having more then 6 years of experience in .NET Technology.
Browse by Tags · View All
#ASP.NET 88
#DOTNET 87
BRH 79
ASP.NET 72
#.NET 52
C#.NET 48
DOTNET 44
ASP.NET 4.0 31
ASP.NET MVC 29
VisualStudio 27

Archive · View All
December 2010 16
July 2011 13
April 2011 13
April 2012 12
January 2011 12
June 2011 11
May 2011 11
May 2012 8
February 2013 7
January 2013 7

TakeWhile operator in linq

Apr 14 2012 4:14PM by Jalpesh   

In this post I am going to explain TakeWhile Operator in details. TakeWhile is one of partitioning operator available in Linq. It will take sequence until condition becomes false.

Here is the example for that.

using System;
using System.Collections.Generic;
using System.Linq;
namespace Linq
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers ={10,9,8,7,6,5,4,3,2,1};

            foreach(var number in numbers.TakeWhile(n=>n>5))
            {
                Console.WriteLine(number);
            }
        }
    }
}

In the above code you can see that I taken an array of number from 10 to 1 and I am printing number with take while operator and I have putted condition like number should be greater then 5. So it will take sequence of all the number until conditions becomes false.Following is the output as expected.

Take while operator in C#

That’s it. Hope you like it. Stay tuned for more. Till than happy programming.

Shout it

Tags: #LINQ, LINQ,


Jalpesh
15 · 11% · 3478
2
 
0
Lifesaver
 
0
Refreshed
 
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"TakeWhile operator in linq" rated 5 out of 5 by 2 readers
TakeWhile operator in linq , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]