``` var list: List<xyzClass> = listOf() dat...
# announcements
c
Copy code
var list: List<xyzClass> = listOf()

data class xyzClass(
    var nullableString? = null
)

list.filterNotNull()
it will not filter if nullableString is null.
s
unfortunately, due to type system constraints, you may need to have a cast here
Copy code
items.asSequence()
    .filter { it.nullable != null }
    .groupBy { it.nullable as String }
c
ok that's fair point. Thanks @Shawn
👍 1