-
-
Save feng-ming/b27144f3b6a29cc88f28a78b37b87742 to your computer and use it in GitHub Desktop.
sdf #java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<String> entriesSortedByValues(List<String> lists) { | |
Collections.sort(lists, | |
new Comparator<String>() { | |
@Override | |
public int compare(String o1, String o2) { | |
return o2.split("\\|")[0].compareTo(o1.split("\\|")[0]); | |
} | |
} | |
); | |
return lists; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment