kotlin filter map by value
val studentsMap = mapOf(101 to "Asha", 102 to "John", 103 to "Afra", 104 to "Kyle")
val filteredMap = studentsMap.filter { (_, value) -> values.endsWith("a)}
kotlin filter map by value
val studentsMap = mapOf(101 to "Asha", 102 to "John", 103 to "Afra", 104 to "Kyle")
val filteredMap = studentsMap.filter { (_, value) -> values.endsWith("a)}
kotlin filter map by key
val studentsMap = mapOf(101 to "Asha", 102 to "John", 103 to "Afra", 104 to "Kyle")
val filteredMap = studentsMap.filter { (key, _) -> (key < 103)}
kotlin map filter
val studentsMap = mapOf(101 to "Asha", 102 to "John", 103 to "Afra", 104 to "Kyle")
val filteredMap = studentsMap.filter { (_, value) -> value.startsWith("A")}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us