1. 程式人生 > >字符串轉Unicode碼

字符串轉Unicode碼

har eat string var nbsp char 字符串 code ons

var str = ‘中‘;

var charCode = str.charCodeAt(0);

console.log(charCode); // => 20013;

str.charCodeAt(0).toString(16);//=>"4e2d"

字符串轉Unicode碼