例子代码如相,原理我还没弄明白
package example;
import java.io.UnsupportedEncodingException;
/**
* Unicode 码转成汉字
* @author peidw
*
*/
public class CodeFormTest {
public static void main(String args[]) throws UnsupportedEncodingException{
String a="开始兑奖";
String str = a.replaceAll("",",").replaceAll(";","");
String [] s2 = str.split(",");
String s1 ="";
System.out.println(s2.length);
for (int i=1;i<s2.length;i++){
int v = Integer.parseInt(s2[i],10);
s1=s1+(char)v;
}
System.out.println(s1);
}
}
posted on 2008-02-18 16:18
有猫相伴的日子 阅读(4837)
评论(3) 编辑 收藏 所属分类:
jdk