Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 13th, 2018 88 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. let c = Character(Unicode.Scalar("98765")!)
  2.    
  3. let c = Character(Unicode.Scalar(12345)!)  
  4. (`Unicode.Scalar("12345")!` causes runtime crash.)
  5.    
  6. extension Character {  
  7.     init?(_ codePoint: UInt32) {  
  8.         guard let us = Unicode.Scalar(codePoint) else {  
  9.             return nil  
  10.         }  
  11.         self = Character(us)  
  12.     }  
  13. }  
  14.  
  15. print(Character(12345)!)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top