Created
April 25, 2016 06:52
-
-
Save alexkent/af8794e0a1032bddf7e8d67fd530054a to your computer and use it in GitHub Desktop.
This file contains 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
import Foundation | |
let string = "e5cfb500" | |
for var index = string.startIndex; index < string.endIndex; index = index.advancedBy(2) { | |
let rangeOfCharacterPair = Range<String.Index>(index..<index.advancedBy(2)) | |
let characterPair = string.substringWithRange(rangeOfCharacterPair) | |
print(characterPair) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wait a second, I didn't see @paoloboschini's comment using
stride
. That's clever! How about this even?