[Solved] How to convert a list of string to map in Scala?


You can use List#grouped to create a non-overlapping window:

list.grouped(2).map(l => (l(0), l(1))).toMap

7

solved How to convert a list of string to map in Scala?