Groovy web console

subscribe to the feed Subscribe
to this
site

String to Map to String

Published 1 month ago by Abhishek Simon
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
String aStr = "{\"impacted_connectors\": [\"Oracle\",\"Sale\"]}"
println aStr 
def mObj= new groovy.json.JsonSlurper().parseText(aStr )["impacted_connectors"]
def mStr = groovy.json.JsonOutput.toJson(mObj)
println mStr?.substring(1, mStr?.length()-1)