ron
04/03/2019, 1:38 PMdata class Book (val title: String, val types: String)
val booklist = listOf(
Book("1", "a b c"),
Book("2", "b c d"),
Book("3", "e f g"),
Book("4", "a g h")
)
val toinclude="a g".split(" ")
val toExclude ="f h".split(" ")
booklist.filter { book ->
toinclude.any { it in book.types }
}.filter { book->
toExclude.none { it in book.types }
}.forEach { println(it) }