I have two lists :
a = [1,2,3]
b = ["?",1,2,"?",4,"?"]
In the second list, I need to replace the first "?" with first element of a(i.e a[0]) and second "?" with a[1] and so on(provided that the number of "?" = size of a) and the result as modified b.
How I can do this groovy-er way?
Thanks in advance.
Some simple solutions:
This returns the result in a new list (you can assign this result to the
bvariable)This modifies the list referenced by
b