groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Rubel <oru...@gmail.com>
Subject Re: How create a custom string literal type
Date Sun, 03 May 2015 16:06:52 GMT
oops...sorry scanned too fast ignore my response.

Owen Rubel
415-971-0976
orubel@gmail.com

On Sun, May 3, 2015 at 9:01 AM, Paolo Di Tommaso <paolo.ditommaso@gmail.com>
wrote:

> Hi,
>
> I would need to implement a string literal in which the dollar char is not
> interpreted as variable placeholder, indeed to use a custom character to
> interpolate variables.
>
> For example I would like define a string like this:
>
>
> def DONE = 'Task completed'
>
>
> def script = /%
>
> mv file_name $HOME
> echo %DONE
> /%
>
>
>
> In which the $HOME string is ignored while  %DONE is interpolated as a
> groovy variable.
>
> Is there any way to do that ?
>
>
> Cheers,
> Paolo
>
>
>
>

Mime
View raw message