October 2018
Intermediate to advanced
370 pages
9h 15m
English
filterNot is the opposite of the filter function. It takes a lambda expression and returns a new list. We can write a filter that can filter out odd numbers as follows:
newList = numbers.filterNot { it % 2 == 0 }println("Filter out Odd numbers")println(newList)
Read now
Unlock full access