Created
March 2, 2018 15:31
-
-
Save iljaiwas/5fab5b1179c58a1bb1014e915e0f8ec0 to your computer and use it in GitHub Desktop.
Swift Data Ranges
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 Cocoa | |
var str = "01234567890123456789012345678901234567" | |
var buffer = Data() | |
if let data = str.data(using: .utf8) { | |
buffer.append(data) | |
buffer = buffer[15..<38] | |
buffer = buffer[2..<23] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment