illegal string body character after dollar sign

前端 未结 4 1242
既然无缘
既然无缘 2020-12-25 14:33

if i define a groovy variable

def x = \"anish$\"

it will throw me error, the fix is

def x = \"anish\\$\"

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-25 15:15

    It might be a cheap method, but the following works for me.

    def x = "anish" + '$'
    

提交回复
热议问题