def l = ["My", "Homer"]
String s = "Hi My Name is Homer"
def list = s.split(" ")
println list
list.each{it ->
l.each{it1 ->
if (it == it1)
println "found ${it}"
}
}
I want to check whether big list (list
) contains all elements of sublist (l
)
Does groovy have any built in methods to check this or what I have in the above code will do?