开发者

Groovy - Strings with "$"

开发者 https://www.devze.com 2023-04-10 02:10 出处:网络
Is 开发者_运维知识库there any way to by pass \"$\" keyword at runtime eg println $anish output will be

Is 开发者_运维知识库there any way to by pass "$" keyword at runtime eg println $anish

output will be $anish


Either use single quoted strings:

println '$anish'

Or escape the dollar as Tom suggests

println "\$anish"


with a backslash println \$anish

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号