Remove item from array by value


I have an array and want to remove one (or more) element based on a specific value.


// Initialize the Array
var a = ["one", "two", "three"]

// Remove/filter item with value 'two'

a = a.filter { $0 != "two" }


Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)