github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/compact.mdx (about) 1 --- 2 page_title: compact - Functions - Configuration Language 3 description: The compact function removes 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 empty string 9 elements removed. 10 11 ## Examples 12 13 ``` 14 > compact(["a", "", "b", "c"]) 15 [ 16 "a", 17 "b", 18 "c", 19 ] 20 ```