Groovy Return function

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Groovy Return function

RJ Guroo
I am a newbie to Groovy. Our application takes groovy inline script to modify some variables for the application.

var1 ="abc" ; and the we to convert to uppercase and return "ABC" to appvar1. Something like

"appvar1" : "groovy { return toUpperCase(var1) }"

2nd requirement is that remove space chars in another variable. var2=" abc def"

"appvar2" : "groovy { def s=var2 return s.replaceAll(~/ /, "") }"

I have put in some vague syntax to explain. How do we include functions in the return statement?  Thanks