区分string中的字母和汉字

来源:互联网 发布:java线程池创建的方式 编辑:程序博客网 时间:2024/04/26 12:57
@Test

public void show(){

String str="我abc";
byte[] bytes = str.getBytes();
for (byte b : bytes) {
System.out.println(b);
}



}

输出结果

-26
-120
-111
97
98
99