In my app, I'm filtering a file array by various types, like the following:
val files:Array[File] = recursiveListFiles(file)
.filter(!_.toString.endsWith("png"))
.filter(!_.toString.endsWith("gif"))
.filter(!_.toString.endsWith("jpg"))
.filter(!_.toString.endsWith("jpeg"))
.filter(!_.toString.endsWith("bmp"))
.filter(!_.toString.endsWith("db"))
But it would be more neatly to define a method which takes a String array and returns all those filters as a concatenated function. Is that possible? So that I can write
val files:Array[File] = recursiveListFiles(file).filter(
notEndsWith("png", "gif", "jpg", "jpeg", "bmp", "db")
)