공부
[kotlin] `list` to `map` {key: index}
승가비
2022. 8. 9. 23:22
728x90
IntStream.range(0, alphabet.size())
.boxed()
.collect(toMap(alphabet::get, i -> i));
How to convert List to Map with indexes using stream - Java 8?
I've created method whih numerating each character of alphabet. I'm learning streams(functional programming) and try to use them as often as possible, but I don't know how to do it in this case: p...
stackoverflow.com
728x90