判断字符的unicode码的位置,汉字在一定的区域里,找找吧

解决方案 »

  1.   

    判断字符的unicode码的位置,汉字在一定的区域里,找找吧
      

  2.   

    试试下述代码没问题呀
    public class testProgram {
      public testProgram() {
      }
      public static void main(String[] args) {
         String str="a中国人民解放军";
         System.out.println(str);
         System.out.println("partial:"+str.substring(0,2).concat("..."));
      }
    }
      

  3.   

    如果是在JSP页面中执行的话,在页面的开始加上
    <%@ page contentType="text/html; charset=GBK" %>也不会有问题的
      

  4.   

    把字符传到变量,和Byte类型 0000000011111111 “与”操作,判断高8位是否为
    "00000000"(你也可以“>>”8次)!本方法对于奇怪字符(如按ctrl键后的组合字符无效!)--------------请高手指教!