标签:ihe blog style ati 字符 har 判断 ring java
public class HanZiHePinYin { public static void main(String[] args) { String aa="sdad中国,.ss"; char[] charArray = aa.toCharArray(); for (char c : charArray) { int cnorEn = isCnorEn(c); System.out.println(c+":"+cnorEn); } } static int isCnorEn(char c){ if(c >= 0x0391 && c <= 0xFFE5) //中文字符 return 1; if(c>=0x0000 && c<=0x00FF){ //英文字符 return 2; } return 3; } }
标签:ihe blog style ati 字符 har 判断 ring java
原文地址:http://www.cnblogs.com/go4mi/p/6032504.html