-1
如何获得给定字符串的Unicode编号?我怎样才能获得一个字符的unicode号码?
例如,西里尔字母小写字母尔U + 0440代表 “р”
我怎样才能获得 “U + 0440” 或 “0440”?
====技术信息====
Unicode数字:U + 0440
HTML码:&#1088
var myString = "р"
for scalar in myString.unicodeScalars {
print("\(scalar.value) ") // print: 1008
}
请检查http://stackoverflow.com/questions/24102044/how-can-i-get-the-unicode-code字符点 – Kendel
'“Hello”.unicodeScalars.map {$ 0.value}' –