Click here to Skip to main content
16,021,226 members
Articles / Programming Languages / C#

Replacing foreach loop with LINQ

Rate me:
Please Sign up or sign in to vote.
4.38/5 (5 votes)
22 Oct 2011CPOL 15.3K  
Isn't it possible to remove the from and select statements by using a lambda expression?var bestStudents=students.Where(s=>s.Grade>9);

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Wales Wales
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions