Skip to content

Instantly share code, notes, and snippets.

@sullenel
Created February 5, 2022 17:44
Show Gist options
  • Save sullenel/6adbf0c4b1b1ff076f27170a2f730149 to your computer and use it in GitHub Desktop.
Save sullenel/6adbf0c4b1b1ff076f27170a2f730149 to your computer and use it in GitHub Desktop.
Print Unicode code point name
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