Stephan van Hulst wrote:No, you can't sort maps by value (or any property of the value).
You can convert the map to a list of entries though, and sort that based on the values of the entries.
salman khandu wrote:
How can I achieve it? I have done with that but it doesn't sort by length.
Yes, you can.
Ekrem Candemir wrote:I don't know whether we can share link from other sites . . .
Why would you want to do that? If you work out what you are going to do, you may be able to find a more elegant way to achieve it.
salman khandu wrote:How can I achieve it?