On Sunday, 25 August 2019 at 16:54:33 UTC, Samir wrote:
Is there a way to output the values of an associative array based on the lexicographic order of the keys?For example, if foo = ["VXE":8, "BZP":5, "JLC":2], I'd like to output something like:5 2 8
auto foo = ["VXE":8, "BZP":5, "JLC":2]; foo.byPair.array.sort!"a[0]<b[0]".map!"a[1]".writeln;