Groovy web console

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

parse json string

Published 1 month ago by nmrao with tags json
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def string = """{"1":[],"2":[],"3":[{"name":"PVR_Test_Product","id":"100048"}],"4":[],"5":[]}"""
def json = new groovy.json.JsonSlurper().parseText(string)
println json.keySet()
assert json instanceof Map