3

Is there any Java method that does exactly the same thing as Pyton's filter()? If so, which library is it in?

petajamaja
  • 520
  • 2
  • 9
  • 26

1 Answers1

5

It's coming in Java 8. For the moment, your best bet is to use the Guava library, which has an Iterables.filter() (or FluentIterable.filter()) method.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255