Created
May 13, 2021 07:21
-
-
Save forketyfork/7d1757ddcdc053fb72bbf180f7df2451 to your computer and use it in GitHub Desktop.
Code to article "Custom String Comparison in 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
var strings = List.of("aaa", "bbb", "ddd", "ccc", "aba"); | |
var sortedStrings = strings.stream().sorted().toList(); | |
System.out.println(sortedStrings); | |
// => [aaa, aba, bbb, ccc, ddd] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment