<Convert String into list of Pairs: Kotlin> Is the...
# stackoverflow
r
Convert String into list of Pairs: Kotlin Is there an easier approach to convert an Intellij IDEA environment variable into a list of Tuples? My environment variable for Intellij is GROCERY_LIST=[("egg", "dairy"),("chicken", "meat"),("apple", "fruit")] The environment variable gets accessed into Kotlin file as String. val g_list = System.getenv("GROCERY_LIST") Ideally I'd like to iterate over g_list, first element being ("egg", "dairy") and so on. And then ("egg", "dairy") is a tuple/pair I have tried to split g_list by comma...