Groovy web console

subscribe to the feed Subscribe
to this
site
Testing (via #groovywebconsole)
tweet this snippet Tweet
this
script

Testing

Published 8 months ago by Anonymous with tags List
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
//def value= ["/apidom-3.0.jar-hotfix-Ganges_3_1-poms_ui-2017-02-22-18-09-57","/apidom-3.0.jar-hotfix-Ganges_3_1-poms_ui-2017-02-23-15-03-39","/apidom-3.0.jar-hotfix-Ganges_3_1-poms_ui-2017-02-23-16-24-27","/apidom-3.0.jar-hotfix-Ganges_3_1-poms_ui-2017-02-27-14-40-44","/apidom-3.0.jar-hotfix-Ganges_3_1-poms_ui-2017-02-27-16-36-57"]
def employee = ["apple-dev","moto-rel","redmi-h","cool-hot"];
def branch=["dev","rel","hot"]

//List of Env
def devList = []
def relList = []
def hotList = []

//Adding values to corresponding list
for(emp in employee) {     
if(emp.contains("dev"))
devList.add(emp)
if(emp.contains("rel"))
relList.add(emp)
if(emp.contains("hot"))
hotList.add(emp)
}

//Printing list
print devList
print relList
print hotList