Sorting a string with number is done differently from one language to another. For example, in English digits come before letters in an ascending sorting. But, in German, digits are ascendant sorted after letters.
I tried to sort strings using a Collator as follows:
private Collator collator = Collator.getInstance(Locale.GERMANY);
collator.compare(str1, str2)
But above comparison does not take into account digits after letters rule.
Does any one have an idea why Java is not taking this rule (digits after letter) into account for the time being I am using RuleBasedCollator as follows:
private final String sortOrder = "< a, A < b, B < c, C < d, D < e, E < f, F < g, G < h, H < i, I < j, J < k, K < l, L < m, M < n, N < o, O < p, P < q, Q < r, R < s, S < t, T < u, U < v, V < w, W < x, X < y, Y < z, Z < 0 < 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9";
private Collator collator = new RuleBasedCollator(sortOrder);