Last active
December 1, 2017 12:41
-
-
Save ole/9382e1dd683820ac7d9e1df7f9dd7232 to your computer and use it in GitHub Desktop.
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
let s = "Hello World" | |
let evenIndices = s.indices.enumerated() | |
.filter { $0.offset % 2 == 0 } | |
.map { $0.element } | |
for idx in evenIndices { | |
print(s[idx]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment