function chkHalf(str){   

      for(var i=0;i

          {      

             strCode=str.charCodeAt(i);      

             if((strCode>65248)||(strCode==12288)){      

                       alert("有全角字符");   

                      break;    

             }    

          }     

} 







if(str.getBytes().length==string.length){    

//全是半角    

}    

if(str.getBytes().length > str.length && str.getBytes().length != str.length){    

//混合    

}    

if(str.getBytes().length == str.length *2){    

//全是全角    

} 

 

相关文章:

  • 2022-02-18
  • 2021-12-26
  • 2022-12-23
  • 2021-07-06
  • 2021-11-25
  • 2022-03-01
猜你喜欢
  • 2021-08-19
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案