Javascript中char和int的互相转换的代码(转载)

Javascript中char和int的互相转换的代码

 
// Converts an integer (unicode value) to a char
function itoa(i)

   return String.fromCharCode(i);
}


// Converts a char into to an integer (unicode value)
function atoi(a)

   return a.charCodeAt();
}
posted @ 2013-05-05 17:29  AStronghcm  阅读(1226)  评论(0编辑  收藏  举报