Created
October 15, 2020 18:15
-
-
Save foxicode/a48478e2761f08045a619fec68c17cb9 to your computer and use it in GitHub Desktop.
Conversions between Data and String in Swift
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
| import Foundation | |
| let str = "Just a text string" | |
| let data = str.data(using: .utf8)! | |
| let str2 = String(decoding: data, as: UTF8.self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment