We have an enum
enum listE {
LE1,
LE4,
LE2,
LE3
}
Furthermore, we have a list that contains the strings ["LE1","LE2","LE3","LE4"]
. Is there a way to sort the list based on the enum defined order (not the natural String
order).
The sorted list should be ["LE1", "LE4", "LE2", "LE3"]
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…