Issue
i have 2 lists in groovy and im trying to 'filter' one list from the other,and get them into a new list .I'm also doing that in a groovy function for a jenkins pipeline I'm writing. Many thank.
l1 = ['abc','def','ghi','jkl']
l2 = ['def','jkl']
def sum = []
for (y in l1) {
for (x in l2) {
if (x != y){
sum = sum + x
}
}
}
print sum
Solution
eventually I did this and it worked
sum = l1 - l2
print "${sum}" //prints the elements in the array
Answered By - DlekaShelHaHaim
Answer Checked By - Robin (JavaFixing Admin)