Created
July 15, 2023 18:24
-
-
Save AviTsadok/7d4b6d7d202ba7d9a8425c6713429f42 to your computer and use it in GitHub Desktop.
Filter Name For Each
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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