📜  如何在 Swift 中查找列表项的索引? - 斯威夫特代码示例

📅  最后修改于: 2022-03-11 15:01:03.039000             🧑  作者: Mango

代码示例1
let arr = ["a","b","c","a"]

let indexOfA = arr.firstIndex(of: "a") // 0
let indexOfB = arr.lastIndex(of: "a") // 3