4 ms·
Not as a general case, but something like (not withstanding missing range checks) below: private String[] alphabetIndex = new String["A", "B"...]; public Stri
by SillyUsername 2y ago
Not as a general case, but something like (not withstanding missing range checks) below:
private String[] alphabetIndex = new String["A", "B"...];
public String getLetterAtIndex(int index1Based) {
return alphabetIndex[index1Based-1];
}
- high_na_euv 2y agoSwitch is useful for simple code dependent on e.g kind or expression, not just as a mapper