要获得字符的Unicode编码,可以使用string.charCodeAt(index)方法,其定义为:
strObj.charCodeAt(index)
index为指定字符在strObj对象中的位置(基于0的索引),返回值为0与65535之间的16位整数。例如:
var strObj = ABCDEFG;
var code = strObj.charCodeAt(2); // Unicode value of character 'C' is 67
如果index指定的索引处没有字符,则返回值为NaN。
要将Un