Comparing strings by their alphabetical order November 30, 2022 by Tarik String.compareTo might or might not be what you need. Take a look at this link if you need localized ordering of strings.