//获得字符字节长度
function getStrByteLen(str)
{
if(str =='') {
return true;
} else {
var out = str.replace(/[^/x00-/xff]/g,'**');
//alert("out.length = " + out.length);
if(out.length > 5) {
alert("输入字符长度过长");
return false;
}
return true;
}
}
JS 判断字符字节长度
最新推荐文章于 2022-09-28 11:36:16 发布