You can take only the results you want: with the LINQ - TAKE Operator

By [)ia6l0 iii

The LinQ Take operator lets you take only the results you want. See below for an code sample.


string[] breakfastItems = { "egg", "yolk", "omlette", "pizaa", "bread" };  
var eggiterianBreakfast  = breakfastItems.Take(3);        

The above code sample would select the first three items from the array.


Related FAQs

The LinQ SKIP operator lets you skip the results you want, and take the rest. See below for an code sample.
You can take only the results you want: with the LINQ - TAKE Operator  (512 Views)