Click here to Skip to main content
12,359,102 members (31,605 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

7.9K views
Posted

Replacing foreach loop with LINQ

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

License

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

Share

About the Author

George Swan
Student
Wales Wales
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralReason for my vote of 2 Possible but (to some of us) not pre... Pin
dmjm-h1-Nov-11 5:40
memberdmjm-h1-Nov-11 5:40 
GeneralReason for my vote of 4 Optimized the code and reduced the e... Pin
Rags151222-Oct-11 22:59
memberRags151222-Oct-11 22:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 22 Oct 2011
Article Copyright 2011 by George Swan
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid