Created
February 5, 2022 17:44
-
-
Save sullenel/6adbf0c4b1b1ff076f27170a2f730149 to your computer and use it in GitHub Desktop.
Print Unicode code point name
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 charToPrintName = "A" | |
let unicodeName = String(charToPrintName).applyingTransform( | |
StringTransform(rawValue: "Any-Name"), | |
reverse: false | |
)! // Forced unwrapping is legit here because it always succeeds. | |
print(unicodeName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment