/**
* 根据assii码获得字符
* @param assii (assii要大于0)
* @return
*/
private String getChar(int assii){
String str = "";
String[] c = {"A","B","C","D","E","F","G","H","I","J","K","L",
"M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
int x = 0;
int y = 0;
if(assii%26==0){
x = assii/26;
if(x > 26){
str=getChar(x-1)+c[25];
}else if(x == 1){
str = c[25];
}else{
str =getChar(x-1)+c[25];
}
}else{
x = (int)MathUtils.roundDown(assii/26.0, 0);
if(x > 26){
str=getChar(x);
}else if(x > 0){
str = c[x-1];
}
y = assii%26;
str = str+c[y-1];
}
return str;
}
用递归得到Execl的列头字符
最新推荐文章于 2022-05-17 18:50:04 发布