Remove null items from a list in Groovy

Viewed 49669

What is the best way to remove null items from a list in Groovy?

ex: [null, 30, null]

want to return: [30]

8 Answers

Another way to do it is [null, 20, null].findResults{it}.

Related