Message Boards Message Boards

How to select only empty elements into a new list?

Posted 10 years ago

How can I take a list and remove all empty elements...

 {{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, 
{}, {}, {}, {}, {}, {}, {}, {}, {"nonempty element"}, {}, {}, {}, {}, {}}
POSTED BY: Wael Elrifai
4 Replies
Posted 10 years ago

Thanks Isaac, I'm really just starting out with Wolfram so I'm making basic errors. Problem solved!

POSTED BY: Wael Elrifai
POSTED BY: Isaac Abraham
Posted 10 years ago
POSTED BY: Wael Elrifai

This may be what you seek.

Select[list, # != {} &]
(* Out:= {{"nonempty element"}} *)
POSTED BY: Isaac Abraham
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract