github.com/terramate-io/tf@v0.0.0-20230830114523-fce866b4dfcd/website/docs/language/functions/compact.mdx (about) 1 --- 2 page_title: compact - Functions - Configuration Language 3 description: The compact function removes null or empty string elements from a list. 4 --- 5 6 # `compact` Function 7 8 `compact` takes a list of strings and returns a new list with any null or empty string 9 elements removed. 10 11 ## Examples 12 13 ``` 14 > compact(["a", "", "b", null, "c"]) 15 [ 16 "a", 17 "b", 18 "c", 19 ] 20 ```