Skip to main content
a tag alone is not quite sufficient for a question specific to a particular kind of shell
Link

Remove all empty strings from an array in Zsh

Became Hot Network Question
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264
Source Link
Jay
  • 255
  • 2
  • 6

Remove all empty strings from an array

How do I remove all empty strings from a Zsh array?

a=('a' '' 'b' 'c')
# remove empty elements from array
echo ${(j./.)a}

Should output a/b/c