IterableExtension<T> extension

An extension for Iterable.

on

Properties

firstOrNull → T?
Returns the first element of the collection, or returns null if the collection is empty.
no setter
lastOrNull → T?
Returns the last element of the collection, or returns null if the collection is empty.
no setter

Methods

repeat(int totalCount) List<T>
Returns a new list containing totalCount count of the given list.
separate(T separator) List<T>
Returns a new list with separator between items.
separateWithBuilder(T builder(int)) List<T>
Returns a new list with separator build by builder, between items.