Groovy web console

subscribe to the feed Subscribe
to this
site

map

Published 4 months ago by Gopal with tags Groovy
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def S ="""define contact{
	name IGI
	alias liberty
	}
	define contact{
	name IGI1
	alias liberty1
	}"""
	def name=S.findAll(/(?<=name).*/)
	def alias=S.findAll(/(?<=alias).*/)
	def newS=[:]
	for(i=0;i<name.size;i++){ 
     for(j=i;j<=i;j++){
            newS.put(name[i],alias[j])
      }
	}
	println newS