java 字符数,字节数

来源:互联网 发布:无线网找不到网络 编辑:程序博客网 时间:2024/04/30 08:39

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

运行结果:5#10