How to remove an element of a given value from an array in Swift
A filter:
let farray = arr.filter {$0 != "b"}
var array : [String]
array = ["one","two","one"]
let itemToRemove = "one"
while array.contains(itemToRemove) {
if let itemToRemoveIndex = array.index(of: itemToRemove) {
array.remove(at: itemToRemoveIndex)
}
}
print(array)
Works on Swift 3.0.