Issue
How to sort a list of objects by the alphabetical order of one of its properties (Not the name but the actual value the property holds)?
Solution
You can pass a comparison function to List.sort
.
someObjects.sort((a, b) => a.someProperty.compareTo(b.someProperty));
Answered By - Nate Bosch
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.