Groovy web console

subscribe to the feed Subscribe
to this
site
from list to map of key-values transformation (via #groovywebconsole)
tweet this snippet Tweet
this
script

from list to map of key-values transformation

Published 1 month ago by marcello.desales@gmail.com 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"]