Element Operator-ElementAt
The ElementAt operator returns the element at a given index in a sequence.
This sample prints the fourth number less that 5 in an integer array. The sample first uses a query expression then uses ElementAt to retrieve the fourth number from this sequence. Since ElementAt uses 0-based indexing, 3 is passed to the method to retrieve the fourth element.
Example:
| using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication4 int fourthLowNum = (from n in numbers Console.WriteLine("Fourth number < 5: {0}", fourthLowNum); Console.ReadLine(); |
Output:
Aspnet Discussion
- - Web application
- - Great Indian Developer Su
- - Aspx page inside Silverli
- - Open aspx page inside Sil
- - Guidance for a novice





