Unnati
12
Q:

c sharp list indexer

// Get the first item from the list

using System.Linq;

var myList = new List<string>{ "Yes", "No", "Maybe"};
var firstItem = myList.ElementAt(0);

// Do something with firstItem
3
// You can index a List using listName[int]
List<string> stringList = new List<string>{"string1", "string2"};
string name = stringList[1];
// Output:
// "string2"
2

New to Communities?

Join the community