github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/collection/compact.mdx (about) 1 --- 2 layout: docs 3 page_title: compact - Functions - Configuration Language 4 sidebar_title: compact 5 description: The compact function removes empty string elements from a list. 6 --- 7 8 # `compact` Function 9 10 `compact` takes a list of strings and returns a new list with any empty string 11 elements removed. 12 13 ## Examples 14 15 ```shell-session 16 > compact(["a", "", "b", "c"]) 17 [ 18 "a", 19 "b", 20 "c", 21 ] 22 ```