I am trying to find an item index by searching a list. Does anybody know how to do that?
item index
list
I see there is list.StartIndex and <
list.StartIndex
Swift 2.1
var array = ["0","1","2","3"] if let index = array.indexOf("1") { array.removeAtIndex(index) } print(array) // ["0","2","3"]
Swift 3
var array = ["0","1","2","3"] if let index = array.index(of: "1") { array.remove(at: index) } array.remove(at: 1)