View Single Post
Old Jun 13th, 2006, 3:58 PM   #8
Gumby
Newbie
 
Join Date: Mar 2006
Location: Andover, MA / Rochester, NY / Nanticoke, PA
Posts: 16
Rep Power: 0 Gumby is on a distinguished road
Send a message via AIM to Gumby
Quote:
Originally Posted by titaniumdecoy
You can simplify this function as follows, such that you don't declare unnecessary variables.

private static String makeStr(int num) {
    String s1 = String.valueOf((char)('a' + num / 26));
    String s2 = String.valueOf((char)('a' + num % 26));
    return s1 + s2;
}
And this is why I love this site. Thank you!
Gumby is offline   Reply With Quote