Groovy web console

subscribe to the feed Subscribe
to this
site

test

Published 1 month ago by Mememe with tags debug findAll
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def IDT = ["12","22","39"]
def SD = ["12","18","88"]

def foundOriginsRawSQL = "88,12"
def splitedFoundOrigins = foundOriginsRawSQL.split(',')


def d = SD.findAll({
el -> 
println('el => ' + el)
println('splitZ =>' + splitedFoundOrigins)
println('check el in splited with .any compareTo == 0 =>' + splitedFoundOrigins.any({it <=> el == 0})) 
println('check el in splited with .any == =>' + splitedFoundOrigins.any({it == el})) 
println('check el in splited with contains=>' + splitedFoundOrigins.contains(el))
println('check el in splited with (el in list) =>' + (el in splitedFoundOrigins))

!splitedFoundOrigins.any({it <=> el == 0})
})

println(d.join(','))