groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesper Steen Møller <jes...@selskabet.org>
Subject Re: About raw string and enhanced try-with-resource
Date Tue, 15 May 2018 10:48:33 GMT
On 15 May 2018, at 12.31, Paolo Di Tommaso <paolo.ditommaso@gmail.com> wrote:
> 
> No. There's an important difference: raw strings do not escape any special character
ie. backlashes, dollars, back-ticks, etc. 
> 

Ah, I didn't actually realize that Groovy's current '''multiline''' style interpreted \ escapes.
Haven't used it much, I suppose.

> 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. 

I totally agree, I was just wrong about the semantics of the '''multiline, non-interpolation
string'''.

-Jesper


Mime
View raw message