Skip to content

Instantly share code, notes, and snippets.

@yunustek
Created October 7, 2018 16:57
Show Gist options
  • Save yunustek/927da92d372fe5159316e99051693557 to your computer and use it in GitHub Desktop.
Save yunustek/927da92d372fe5159316e99051693557 to your computer and use it in GitHub Desktop.
Removing Elements from Collection
var numbers = [5, 6, 7, 8, 9, 10, 11]
numbers.removeAll(where: { $0 % 2 == 1 })
// numbers == [6, 8, 10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment