List<string> _ids = new List<string>() { "aaa", "bbb", "ccc", "ddd" }; var first = _ids[0]; //first element var last = _ids[_ids.Count - 1]; //last element