Is there a nicer way of converting a number to its alphabetic equivalent than this?
private String getCharForNumber(int i) {
char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
if (i > 25) {
return null;
}
return Character.toString(alphabet[i]);
}
Maybe something than can deal with numbers greater than 26 more elegantly too?
See Question&Answers more detail:os