You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2016/02/26 11:32:18 UTC
[jira] [Commented] (GROOVY-7766) Dollar Slashy String swallows new
line
[ https://issues.apache.org/jira/browse/GROOVY-7766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15168793#comment-15168793 ]
Paul King commented on GROOVY-7766:
-----------------------------------
For all multi-line strings in Groovy, a slash on the end of a line is the escape to join the next line as a continuation of the current line.
See the last example in the following part of the documentation:
http://groovy-lang.org/syntax.html#_triple_single_quoted_string
> Dollar Slashy String swallows new line
> --------------------------------------
>
> Key: GROOVY-7766
> URL: https://issues.apache.org/jira/browse/GROOVY-7766
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.5
> Reporter: dariusan
>
> {code}
> //slash with space near newline works
> assert ' \\ \n '.bytes==$/ \
> /$.bytes
> // slash next to newline will be swallowed
> assert ' \\\n '.bytes==$/ \
> /$.bytes
> Assertion failed:
> assert ' \\\n '.bytes==$/ \ /$.bytes
> | | |
> | false [32, 32]
> [32, 92, 10, 32]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)