Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created March 18, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/da2da59dfd078f71f331388ee426ac00 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/da2da59dfd078f71f331388ee426ac00 to your computer and use it in GitHub Desktop.
val authors = listOf("Dmitry", "Svetlana")
val readers = mutableListOf<String>(/* ... */)
fun <T> List<T>.filter(predicate: (T) -> Boolean): List<T>
>>> readers.filter { it !in authors }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment