通过Unicode判断一个字符是不是汉字

首先,汉字的unicode的范围是 0x4e00 到 0x9fa5 之间
function isC(str){
if(str.charCodeAt(0) >= '0x4e00' && str.charCodeAt(0) <= '0x9fa5'){
alert('是汉字');
}else{
alert('不是汉字')
}

原文地址:https://www.cnblogs.com/xk-g/p/9252643.html