ListExtension<E> extension

Convenience methods for splitting, deduplicating, and reordering lists.

on

Methods

chunks(int chunkSize) List<List<E>>

Available on List<E>, provided by the ListExtension extension

Split one large list to limited sub lists
move(int oldIndex, int newIndex) → void

Available on List<E>, provided by the ListExtension extension

Moves the element at oldIndex to newIndex in place.
separatedBy(E separator) List<E>

Available on List<E>, provided by the ListExtension extension

Inserts separator between every element and returns a new list.
swap(int indexA, int indexB) → void

Available on List<E>, provided by the ListExtension extension

Swaps two elements in place.
unique([bool comparator(E a, E b)?]) List<E>

Available on List<E>, provided by the ListExtension extension

Returns a new lazy List with unique elements from this collection.
uniqueBy<K>(K keySelector(E element)) List<E>

Available on List<E>, provided by the ListExtension extension

Returns a new List containing only the elements that have unique keys.