split

fun <T> List<T>.split(partitionSize: Int): List<List<T>>

splits a list into sublists

Return

a List of Lists of T

Parameters

partitionSize

the max size of each sublist. The last sub list may be shorter.


fun <T> Collection<T>.split(index: Int): Pair<List<T>, List<T>>
fun <T> Collection<T>.split(): Pair<List<T>, List<T>>