how generate gstring from a multiple string in groovy?

57 Views Asked by At

Im trying to generate gstring from this code but not works

date="01"


varzcx= "\${"+"date" +"}";
println  varzcx

this print ${date}

I need print 01

please help me

1

There are 1 best solutions below

0
Jeff Scott Brown On BEST ANSWER

Instead of this...

date="01"
varzcx= "\${"+"date" +"}";
println  varzcx

You probably want this...

date="01"
varzcx= "${date}"
println varzcx