Click or drag to resize
ListExtensions Class
Provides an additional set of methods to work with ILists.
Inheritance Hierarchy
SystemObject
  DW.SharpToolsListExtensions

Namespace: DW.SharpTools
Assembly: DW.SharpTools (in DW.SharpTools.dll) Version: 2.4.0.0 (2.4.0.0)
Syntax
C#
public static class ListExtensions

The ListExtensions type exposes the following members.

Methods
Examples
C#
public void IndexOf()
{
    var items = new List<int> { 1, 2, 3 };
    var index = items.IndexOf(i => i % 2 == 0);
}

public void Shuffle()
{
    var items = new List<int> { 1, 2, 3 };
    items = items.Shuffle().ToList();
}

public void Split()
{
    var items = new List<int> { 1, 2, 3, 4, 5, 6 };
    var chunks = items.Split(2);
    foreach (var chunk in chunks)
        Console.WriteLine("Chunk: {0}", string.Join("-", chunk));
}
See Also