当前位置: 技术问答>java相关
如何得到一个字符的ASCII码值?在线等侯!!!
来源: 互联网 发布时间:2017-03-27
本文导语: 如何得到一个字符的ASCII码值?在线等侯!!! | Comment from Kaflanko 10/23/2002 10:56AM PST This will return the ASCII code of each character in given string. To get the ASCII value of just a single cha...
如何得到一个字符的ASCII码值?在线等侯!!!
|
Comment from Kaflanko 10/23/2002 10:56AM PST
This will return the ASCII code of each character in given string. To get the ASCII value of just a single character ('h', for example), use: 'h'.charCodeAt(0);
function stringToASCII(sString){
var i;
var len = sString.length;
var sASCII = new String();sASCII = "";
for (i=0; i
This will return the ASCII code of each character in given string. To get the ASCII value of just a single character ('h', for example), use: 'h'.charCodeAt(0);
function stringToASCII(sString){
var i;
var len = sString.length;
var sASCII = new String();sASCII = "";
for (i=0; i