javascript中 字符、ascii码互换
字符(obj)转ascii码: 用 obj.charCodeAt();
ascii码(oNumber)转字符:用String.fromCharCode( oNumber);
str="A";
code = str.charCodeAt(); //code is 65
str1 = String.fromCharCode(code); //str1 is A
str2 = String.fromCharCode(0x60+26); //str2 is z
字符(obj)转ascii码: 用 obj.charCodeAt();
ascii码(oNumber)转字符:用String.fromCharCode( oNumber);
str="A";
code = str.charCodeAt(); //code is 65
str1 = String.fromCharCode(code); //str1 is A
str2 = String.fromCharCode(0x60+26); //str2 is z