Last active
January 10, 2022 05:59
-
-
Save trilliwon/991149ca2c73f2074f9d5728b7a5e11c to your computer and use it in GitHub Desktop.
String to Data, Data to String
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
// String to Data utf8 | |
let strData: Data = Data("String".utf8) | |
// Data to String | |
let str = String(data: strData, encoding: .utf8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment