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
Where can examine the whole sequence looking for matches.
Enumerable.Range(1, 10).Where(x => x % 2 == 1) // 1, 3, 5, 7, 9
TakeWhile stops looking when it encounters the first non-match.
Enumerable.Range(1, 10).TakeWhile(x => x % 2 == 1) // 1