Property: list.Count (FYI => array.Length)

O(1) operations

// Accessing items by index
list[index] // indexer
list.ElementAt(index) // slower than indexer
list.ElementAtOrDefault(index)

// Adding or removing items at the end
list.Add(T)  // at the end
list.AddRange(IEnumerable<T>)  // at the end
list.RemoveAt(Count - 1)

O(n) operations

list.Contains(T item);
list.Sort();
list.Reverse();
list.IndexOf(T item); // first occurrence

List Method Details

Conversion to string

list to string

var combindedString = String.Join(" ", list); 

string to list

List<string> words = myString.Split(delimiters, StringSplitOptions.RemoveEmptyEntries).ToList();
// T[] delimiters, T == Char, string

List<string> words = myString.Split(" ").ToList()

Conversion to array

list to array

string[] arr = list.ToArray();

array to list

var list = new List<T>(array); // new List<T>(IEnumerable)

var list = array.ToList();

var list = new List<T>();
list.AddRange(array);

Conversion to dictionary

list to dictionary

var dict = list.ToDictionary(x => x, x => x);

// to avoid duplicate key
var dict = list.Distinct().ToDictionary(x => x, x => x);
var dict = list.ToLookup(x => x);

dictionary to list

var keyList = dictionary.Keys.ToList();
var valList = dictionary.Values.ToList();

// key value pair
List<KeyValuePair<string, int>> list = dictionary.ToList();

foreach (KeyValuePair<string, int> pair in list){
  Console.WriteLine(pair.Key);
  Console.WriteLine(pair.Value);
}

// when values are nested list
Dictionary<K, List<V>> dictionary = GetDictionary();
List<List<V>> nestedList = dictionary.Values;
List<V> list = nestedList.SelectMany(item => item).ToList();

How to get duplicate items from a list using LINQ

List<String> duplicates = list.GroupBy(item => item)
                             .Where(g => g.Count() > 1)
                             .Select(g => g.Key)
                             .ToList();

Flattening nested list

List<List<V>> nestedList = GetNestedList();
List<V> list = nestedList.SelectMany(item => item).ToList();