Milo
09/28/2022, 9:11 PMlnunezb6
09/28/2022, 9:13 PMmkrussel
09/28/2022, 9:16 PMList<Pair<String, List<String>>
and if so what is the desired output?Milo
09/28/2022, 9:18 PMChris Lee
09/28/2022, 9:19 PMlist.joinToString("\n")
Milo
09/28/2022, 9:21 PMCountry1, [city1, city2, city3]
Country2, [city4, city5]
but I want
"Country1
city1,
city2,
city3
Country2,
city4,
city5"
Chris Lee
09/28/2022, 9:22 PMlist.map { "${it.first},${it.second.joinToString("\n")}" }
Chris Lee
09/28/2022, 9:23 PMlist.map { "${it.first},${it.second.joinToString(",")}\n" }
Chris Lee
09/28/2022, 9:23 PMMilo
09/28/2022, 9:26 PMmkrussel
09/28/2022, 9:28 PMlist.joinToString(separator = ",\n") { "$it.first,\n${it.second.joinToString(separator = ",\n")}") }