ASC码生成AA-ZZ

private static String getUserCode(int usercode){

int a = 0;
int b = 0;

if(usercode%26!=0){
a = usercode/26+65;
b = usercode%26+64;
}else{
a = usercode/26+64;
b = 90;
}
char co = (char)a;
char de = (char)b;
String str1 = String.valueOf(co);
String str2 = String.valueOf(de);
String str = str1+str2;

return str ;
}

posted on 2016-04-23 15:03  笨的可以  阅读(220)  评论(0)    收藏  举报

导航