slidingString


Description:

public static ArrayList<ArrayList<string>> slidingString (ArrayList<string> list, int windowSize)

Returns sliding windows of the given size over the list.

Example:

    // list = ["a", "b", "c", "d"]
var windows = Lists.slidingString (list, 2);
// [["a","b"], ["b","c"], ["c","d"]]

Parameters:

list

the source list.

windowSize

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

Returns:

an ArrayList of window lists.