Last active
October 14, 2019 07:19
-
-
Save noppefoxwolf/58b951f56e4391cb8fecc9ed70551939 to your computer and use it in GitHub Desktop.
Unified string to emoji.
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
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