Created
July 9, 2020 22:34
-
-
Save toantran-ea/ca1e4de12226deed95b5f8f62ade841c to your computer and use it in GitHub Desktop.
sequence 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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