Skip to content

Instantly share code, notes, and snippets.

@toantran-ea
Created July 9, 2020 22:34
Show Gist options
  • Save toantran-ea/ca1e4de12226deed95b5f8f62ade841c to your computer and use it in GitHub Desktop.
Save toantran-ea/ca1e4de12226deed95b5f8f62ade841c to your computer and use it in GitHub Desktop.
sequence 2
fun main(args: Array<String>) {
val seq = listOf("a", "ba", "cda", "def")
val listFilter1 = seq.filter {
it.length > 1
}
println(listFilter1) // [ba, cda, def]
val listFilter2 = listFilter1.filter {
it.length > 2
}
println(listFilter2) // [cda, def]
val end = listFilter2.toList();
println(end) // [cda, def]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment