Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 2 weeks ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def data = [ [name:'a', src:"a"], [name:"b", src:"b"], [name:"c", src:"c"] ]
def idx = data.findIndexOf { it.src == "a" }
if (idx >= 0) {
  println "Found idx: $idx"
} else {
   println "Not Found idx: $idx"
}