Scala filter on two conditions

arrays, filter, multiple-conditions, scala

Solution

Using slightly less concise lambda syntax:

mystuff = mystuff.filter(x => (x.isX && x.name == "xyz"))

You can find more detail on Scala anonymous function syntax here.

Problem

I would like to filter my data set on two conditions at once. Is it possible? I want something like this: ``` mystuff = mystuff.filter(_.isX && _.name == "xyz") ```

Original source