Groovy web console

subscribe to the feed Subscribe
to this

from list to map of key-values transformation

Published 4 months ago by with tags list map transform
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def envs = ["A=B", "B=C"]
def a = envs.collectEntries{ envKeyValue -> 
   def parts = envKeyValue.split("=")
   [parts[0], parts[1]]

println a["A"]