Java code
public class B { /** * @param args */ void run(String str) { int i; for(i=0;i System.out.println(i+"对应的字符是"+str.charAt(i)); System.out.print("===================="); System.out.println(str.codePointAt(i)); } } public static void main(String[] args) { new B ().run("张三"); } // 24352 19977 } |
输出结果:
0对应的字符是张
====================24352
1对应的字符是三
====================19977
作者:吴旭晓 | 来源:个人博客 | 点击量:1556 | 发布时间:2013-06-26
最新留言 |
返回上一页 |
返回首页