下面的代码无法运行
def map = [name:"Test :: ( %2f %25 \$ * & ! @ # ^)"]
String s = map.inspect()
println Eval.me(s)
得到错误:
Script1.groovy: 1: illegal string body character after dollar sign;
solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 1, column 30.
["name":"Test :: ( %2f %25 $ * & ! @ # ^)"]
但如果字符串包含其他特殊字符,如 \",它可以正常工作。无论如何,如何四处走动?这对我来说很紧急