swift - How can I get unicode number of a character? -


this question has answer here:

how can unicode number of given string ?

for example, cyrillic small letter er u+0440 stands "р"

how can "u+0440" or "0440"?

====technical information====

unicode number: u+0440

html-code: &#1088

var mystring = "р" scalar in mystring.unicodescalars {     print("\(scalar.value) ") // print: 1008 } 

440 in hex equal 1088 in decimal:

var mystring = "р" scalar in mystring.unicodescalars {     print(string(scalar.value, radix: 16)) } 

Comments

Popular posts from this blog

How to use SUM() in MySQL for calculated values -

ios - IBOutlet for image button not correctly referencing button after recreating outlet -

java - AEM: 403 Forbidden occurs when call a Post servlet -