按char读出来,看是否大于255,大于255就属于中文或其他字符了
如果字符串又有中文又有英文你怎么办?

解决方案 »

  1.   

    char judge;
     boolean flag=false;
    for(int i=0;i<strRead.length;i++)
    {
      judge=strRead.charAt(i);//strRead为所读入字符串
       if( (judge>=t)and(judge<=s) )  //对不起,t 和s 是unicode 的英文码,
     //我忘了,你自己查,替换便可;
        flag=ture;
       else {
             flag=false;
             break;
             }
    }
     if(flag)
       System.out.print("English String")
    else
      System.out.print(" other");
      

  2.   

    楼上的几位只是提供了判断是不是unicode的方式并不一定不是中文就不能用unicode的。
      

  3.   

    int intELen=content.length();
    int intCLen=content.getBytes().length;
    if(intELen==intCLen)
    //英文,140
    else
    //中文70