Skip to content

Instantly share code, notes, and snippets.

@hngfu
Last active April 6, 2019 07:55
Show Gist options
  • Save hngfu/fb0862afe1dd619995c33a02d7ec6a0b to your computer and use it in GitHub Desktop.
Save hngfu/fb0862afe1dd619995c33a02d7ec6a0b to your computer and use it in GitHub Desktop.
let scalar = Unicode.Scalar("흥")
let consonantIndex = (scalar.value - 0xac00) / 28 / 21
let consonantScalar = Unicode.Scalar(consonantIndex + 0x1100)!
print(consonantScalar) //ㅎ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment