ElementAt
Jasurbek Xasanboyev
class Program
{
static void Main(string[] args)
{
List<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int res = numbers.ElementAt(5);
Console.WriteLine(res); // OUTPUT: 6
}
}class Program
{
static void Main(string[] args)
{
List<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int res = (from num in numbers
select num).ElementAt(5);
Console.WriteLine(res); // OUTPUT: 6
}
}
Last updated
Was this helpful?