groovygstring

how generate gstring from a multiple string in groovy?


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


Solution

  • Instead of this...

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

    You probably want this...

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