Groups elements by a key extracted from each element.
Example:
var groups = Lists.groupByString (words, (w) => {
return w.substring (0, 1);
});
// groups["a"] = ["apple", "avocado"]
| list |
the source list. |
| keyFn |
the key extraction function. |
|
a HashMap of key to grouped list. |