Visit our archive

In Scala, filtering and processing collections is easy and elegant. There are many filtermethods available, but the most used will probably the basic filter method.

Here’s a code example of some filtering on my (ex)camera collection.
The filter method will not only work on Lists, but on any Scala collection.

Running this example will give you the following result:

  • Name (Required)

  • Email (Required, but not published)

  • Url (Optional)

  • Comment (Required)