Created
October 23, 2020 06:52
-
-
Save BilalSiddiqui/f8b8fa8bcd97f323a86891e89c1e071b to your computer and use it in GitHub Desktop.
Searching and sorting in ArrayList of Kotlin
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
inMemoryCache.filter { | |
it.name.contains(query, true) || | |
(it.description != null && it.description.contains(query, true)) | |
}.sortedWith(compareByDescending<Repo> { it.stars }.thenBy { it.name }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment