Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let c = Character(Unicode.Scalar("98765")!)
- let c = Character(Unicode.Scalar(12345)!)
- (`Unicode.Scalar("12345")!` causes runtime crash.)
- extension Character {
- init?(_ codePoint: UInt32) {
- guard let us = Unicode.Scalar(codePoint) else {
- return nil
- }
- self = Character(us)
- }
- }
- print(Character(12345)!)
Add Comment
Please, Sign In to add comment