Use index:
string the4th = theList[3];
Note that this throws an exception if the list has only 3 elements or less, since the index is always based on zero. You can use Enumerable.ElementAtOrDefault , and then:
string the4th = theList.ElementAtOrDefault(3); if(the4th != null) {
ElementAtOrDefault returns the element at the specified index if index < list.Count and default(T) if index >= theList.Count . Therefore, for reference types (for example, String ), it returns null and for value types their default value (for example, 0 for int ).
For collection types that implement IList<T> (arrays or lists), it uses an index to get the item; for other types, it uses a foreach and a counter variable.
So, you can also use the Count property to check if the list contains enough elements for the index:
string the4th = null; if(index < theList.Count) { the4th = theList[index]; }
source share