marstran
01/11/2018, 9:15 AMgroupBy
does. If multiple values have the same letter, they will end up in the same list. If the list is originally listOf(CarMake("BMW"), CarMake("Bentley"))
, then the result would be {B=[CarMake(name=BMW), CarMake(name=Bentley)]}
.