Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Groovy Online

def data = "periodePaie|desc,prenomUsuel|asc"
def map = [:]

print(data.split(","))


data.split(",").each {param ->
    def nameAndValue = param.split('\\|')
    print("\n")
    print(nameAndValue)
    map[nameAndValue[0]] = nameAndValue[1]
}

print("\n" + map)
print("\n" + map.size() + "\n")

//traitement de la map
map.each {name, value -> 
    println("${name}:${value}")
    
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.