Skip to content

Instantly share code, notes, and snippets.

@AviTsadok
Created July 15, 2023 18:24
Show Gist options
  • Select an option

  • Save AviTsadok/7d4b6d7d202ba7d9a8425c6713429f42 to your computer and use it in GitHub Desktop.

Select an option

Save AviTsadok/7d4b6d7d202ba7d9a8425c6713429f42 to your computer and use it in GitHub Desktop.
Filter Name For Each
func filterName(name: String, fromArray collection: [String]) -> [String] {
var result: [String] = []
for tempName in collection {
if tempName == name {
result.append(tempName)
}
}
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment