I have a Dicitionary where the values are lists. I want to sort these lists inside the Dict.
Dict("Income" => ["Top 10%", "Lower 50%", "31 - 40%", "21 - 30%", "41 - 50%", "Undetermined", "11 - 20%"],
"Age" => ["65+", "55-64", "45-54", "Unknown", "18-24", "25-34", "35-44"],
"Gender" => ["Undetermined", "Female", "Male"],
"Device" => ["Desktop", "Mobile", "Tablet"])
Sorted will be:
Dict("Income" => ["11 - 20%", "21 - 30%", "31 - 40%", "41 - 50%", "Lower 50%", "Top 10%", "Undetermined"],
"Age" => ["18-24", "25-34", "35-44", "45-54", "55-64", "65+", "Unknown"],
"Gender" => ["Female", "Male", "Undetermined"],
"Device" => ["Desktop", "Mobile", "Tablet"])
foreach(sort!, values(mydict))
to make a bit less allocations. – Fisherman