Files
opentf/website/docs/configuration/functions/chunklist.html.md
Martin Atkins e7d71995f6 website: Document the remaining "collection" functions
This also renames some of the existing function pages whose source
filenames were not matching the usual naming scheme (.html.md).
2018-10-16 18:47:33 -07:00

652 B

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
functions chunklist function docs-funcs-collection-chunklist The chunklist function splits a single list into fixed-size chunks, returning a list of lists.

chunklist Function

chunklist splits a single list into fixed-size chunks, returning a list of lists.

chunklist(list, chunk_size)

Examples

> chunklist(["a", "b", "c", "d", "e"], 2)
[
  [
    "a",
    "b",
  ],
  [
    "c",
    "d",
  ],
  [
    "e",
  ],
]
> chunklist(["a", "b", "c", "d", "e"], 1)
[
  [
    "a",
  ],
  [
    "b",
  ],
  [
    "c",
  ],
  [
    "d",
  ],
  [
    "e",
  ],
]