chunkString


Description:

public static ArrayList<ArrayList<string>> chunkString (ArrayList<string> list, int size)

Splits a string list into sub-lists of the given size. The last chunk may be smaller.

Example:

    var chunks = Lists.chunkString (list, 3);

Parameters:

list

the source list.

size

the chunk size (must be > 0, otherwise empty result).

Returns:

an ArrayList of chunk lists.