evaluateを使ってみた。

evaluateを使うと文字列を実行できる。
入力してもらった値を直接使うとかできる。

def s = "['OK':'o_o!']"

evaluate("val = ${ s }")

println val

コメント