Remove item from array by value

 Problem

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



 Recipe


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

// Remove/filter item with value 'two'

a = a.filter { $0 != "two" }
print(a)

				


 Playground