Skip to content

compact Function ​

compact takes a list of strings and returns a new list with any empty string elements removed.

Examples ​

shellsession
> compact(["a", "", "b", "c"])
[
  "a",
  "b",
  "c",
]

Released under the MPL-2.0 License.