我需要获取包含成员fileName =“Andres”的数组的索引
data class File(var fileName: String, var _id : String? = null)
data class Files(val files: Array<File>)
val miObjetG = Gson().fromJson(response_files, Files::class.java)
var indice = miObjetG.files.filterIndexed { index, file -> file.fileName == "Andres"}
1条答案
按热度按时间ncgqoxb01#
我认为indexOfFirst是您正在寻找的: