anish
anish

Reputation: 7422

Groovy - Strings with "$"

Is there any way to by pass "$" keyword at runtime eg println $anish

output will be $anish

Upvotes: 0

Views: 195

Answers (2)

tim_yates
tim_yates

Reputation: 171194

Either use single quoted strings:

println '$anish'

Or escape the dollar as Tom suggests

println "\$anish"

Upvotes: 4

Tom
Tom

Reputation: 9663

with a backslash println \$anish

Upvotes: 0

Related Questions