I have two arrays like this:
var arrayA = [\"Mike\", \"James\", \"Stacey\", \"Steve\"] var arrayB = [\"Steve\", \"Gemma\", \"James\", \"Lucy\"]
Like this:
var arrayA = ["Mike", "James", "Stacey", "Steve"] var arrayB = ["Steve", "Gemma", "James", "Lucy"] for word in arrayB { if let ix = find(arrayA, word) { arrayA.removeAtIndex(ix) } } // now arrayA is ["Mike", "Stacey"]