I want to take an integer and get its ordinal, i.e.:
1 -> \"First\" 2 -> \"Second\" 3 -> \"Third\" ...
In 1 line:
public static String ordinal(int i) { return i % 100 == 11 || i % 100 == 12 || i % 100 == 13 ? i + "th" : i + new String[]{"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"}[i % 10]; }