package com.zken.pkg;
public class T {
public static void main(String[] args) {
t1();
t2();
}
public static void t1() {
String s = "22242 38431 38271";
String[] chars = s.split(" ");
for (int i = 0; i < chars.length; i++) {
System.out.print((char)Integer.parseInt(chars[i]));
}
System.out.println();
}
public static void t2() {
String s = "团队长";
char[] chars = s.toCharArray();
for (int i = 0; i < chars.length; i++) {
StringBuffer b = new StringBuffer();
if(i!=chars.length-1){
b.append((int)chars[i]+" ");
}else{
b.append((int)chars[i]);
}
System.out.print(b);
}
}
}
原文:http://blog.csdn.net/zkn_cs_dn_2013/article/details/22724853