How can I convert this String
variable to a List
?
def ids = "[10, 1, 9]"
I tried with: as List
and toList();
def l = Eval.me(ids)
Takes the string of groovy code (in this case "[10,1,9]") and evaluates it as groovy. This will give you a list of 3 ints.