Skip to content

Instantly share code, notes, and snippets.

@noppefoxwolf
Last active October 14, 2019 07:19
Show Gist options
  • Save noppefoxwolf/58b951f56e4391cb8fecc9ed70551939 to your computer and use it in GitHub Desktop.
Save noppefoxwolf/58b951f56e4391cb8fecc9ed70551939 to your computer and use it in GitHub Desktop.
Unified string to emoji.
let unified = "0023-FE0F-20E3"
var emoji = unified
.split(separator: "-")
.compactMap { Int($0, radix: 16) }
.compactMap { Unicode.Scalar($0) }
.reduce(into: "", { $0.append(String($1)) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment