for Each Chunk Indexed
inline fun <T> List<T>.forEachChunkIndexed(chunkSize: Int, action: (index: Int, InPlaceSubList<T>) -> Unit)(source)
Iterates through the windowed chunks of this collection with given chunkSize, where window step is equals to chunkSize and calls action on each chunk with its index.
The returned chunk is a view into the original list. Changes in the original list will be reflected in the chunk.
Parameters
chunk Size
the number of elements to take in each window.
action
function that takes the index of a chunk and the chunk itself as arguments.