groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Di Tommaso <paolo.ditomm...@gmail.com>
Subject Re: About raw string and enhanced try-with-resource
Date Tue, 15 May 2018 10:31:54 GMT
No. There's an important difference: raw strings do not escape any special
character ie. backlashes, dollars, back-ticks, etc.

This is very useful for DSLs when it's required to embed a piece of foreign
code (think for example Bash) into a string. With groovy multi-line string
you still need to escape a lot stuff, making very difficult for the user to
handle it.


p



On Tue, May 15, 2018 at 12:21 PM, Jesper Steen Møller <jesper@selskabet.org>
wrote:

>
> > On 15 May 2018, at 12.14, Daniel.Sun <sunlan@apache.org> wrote:
> > [..]
> >    As you said, Groovy has many string(e.g. 'xxx', "xxx", '''xxx''',
> > """xxx""", /xxx/, $/xxx/$). but they can not cover the function of raw
> > string...
> >
>
> Isn't '''tripple-single-quoted''' basically the same as the raw string
> (only with a different delimiter?)
>
> -Jesper
>
>

Mime
View raw message