📅  最后修改于: 2022-03-11 14:53:33.502000             🧑  作者: Mango
fun main() {
val asha = Student(101, "Asha")
val john = Student(102, "John")
val afra = Student(103, "Afra")
val kyle = Student(104, "Kyle")
val studentList = listOf(asha, john, afra, kyle)
val filteredList = studentList.filterNot { student ->
student.name.startsWith("K")
}
println(filteredList)
}
data class Student(val id: Long, val name: String)