github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/collection/compact.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: compact - Functions - Configuration Language
     4  description: The compact function removes empty string elements from a list.
     5  ---
     6  
     7  # `compact` Function
     8  
     9  `compact` takes a list of strings and returns a new list with any empty string
    10  elements removed.
    11  
    12  ## Examples
    13  
    14  ```shell-session
    15  > compact(["a", "", "b", "c"])
    16  [
    17    "a",
    18    "b",
    19    "c",
    20  ]
    21  ```