natorder
natorder copied to clipboard
Java Natural Order comparator
Hi This example doesn't come out as expected: Unsorted: "B4S B", "B4A B", "B4 B" Sorted: "B4A B", "B4 B", "B4S B" Expected: "B4 B", "B4A B", "B4S B" I'm...
Dates with time ( i.e. "2020-03-26 10:00:00") and only time (i.e. "10:00:00") does not work as expected. The issue is that 00 comes after 01-09. Expected: > 10:00:00 > 10:00:01...
Ignoring whitespaces does not really produce a nice result: ``` The A The X The a Theme The x ``` If anything, it would be better to ignore them only...
Line 51 is never true for all the examples I put into it. https://github.com/paour/natorder/blob/ab9e2dfd165736a90f3d8784e76c906e6603db52/NaturalOrderComparator.java#L51 Is it supposed to compare with 0 (space) or with 48 (0)? `if (ca == '0'...
Output with case sensitivity (old behavior): > Sorted: [1-2, 1-02, 1-20, 10-20, POLITELY SCREAMING, fred, jane, pic01, pic02, pic2, pic02a, pic3, pic4, pic 4 else, pic 5, pic 5, pic05,...
unsorted : [0.9, 1.0c, 1.2, 1.3, 0.6, 1.1, 0.7, 0.3, 1.0b, 1.0, 0.8] we get Sorted: [0.3, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.0b, 1.0c] i expect that...
It should not skip the zero if there is no other digit. ``` Unsorted: [9, 0, 1, a[9], a[0], a[00], a[1]] Sorted: [0, 1, 9, a[1], a[9], a[0], a[00]] Should...