I have two arrays
var array1 = new Array [\"a\", \"b\", \"c\", \"d\", \"e\"] var array2 = new Array [\"a\", \"c\", \"d\"]
I want to remove
@Antonio's solution is more performant, but this preserves ordering, if that's important:
var array1 = ["a", "b", "c", "d", "e"] let array2 = ["a", "c", "d"] array1 = array1.filter { !array2.contains($0) }