January 2012
Intermediate to advanced
396 pages
8h 16m
English
The second overloaded version lets you use the index of a particular element in the source collection in the query:

So in this case, the Lambda expression will expect two input parameters. The item and its index. Then it will return a bool depending on the parameters.
This can be particularly handy when you want to exclude certain elements from the source collection; while processing:
//This will find all the names in the array "names". //where length of the name is less than or equal to the index of //the element + 1 string[] names = { "Sam", "Pamela", ...Read now
Unlock full access