I want to get a difference between TakeWhile & Where LINQ methods .I got the following data from MSDN .But It didn\'t make sense to me
Where
While the existing answers are correct, none of them point out why you'd want to use TakeWhile if the results would be the same: Performance. Suppose you have an ordered list with 2 billion items in it, and you want the ones that (probably 10 or 15 items) less than a given vallue. The Where clause will examine all 2 billion items, while the TakeWhile will stop as soon as it finds a value equal or greater than your supplied value