字符数,字节数

 

String s="我是中国人";
System.out.println(s.length()+"#"+s.getBytes().length);

运行结果:5#10

 

你可能感兴趣的:(字符数,字节数)