I'm pretty new to C# and cannot figure out how to print the first array element of the list. The code to print all array elements is this:
using System.Collections.Generic;
class Program1 {
static List<string[]> users = new List<string[]>();
static void Main() {
users.Add(new string[]{"Ben", "21", "Germany"});
users.Add(new string[]{"Tom", "32", "Finland"});
foreach(var person in users){
Console.WriteLine($"Name: {person[0]}, Age: {person[1]}, Country: {person[2]}");
}
}
}
Like how can I only print the first array or the first item in the first array and so on? Any help/tip would be really helpful!