Skip to content

Commit

Permalink
Fix minor typo in Groovy intro
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Ribeiro-Dantas <mribeirodantas@seqera.io>
  • Loading branch information
mribeirodantas committed Jun 13, 2024
1 parent e0b79c8 commit 1d20964
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/basic_training/groovy.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ println "The $foxtype ${foxcolor.join()} fox"
x = 'Hello'
y = 'World'
println '$x + $y'
println '$x $y'
```

```console title="Output"
The quick brown fox
$x + $y
$x $y
```

!!! info
Expand All @@ -270,11 +270,11 @@ $x + $y

!!! question "Exercise"

Modify the script above to print `Hello World` instead of `$x + $y`.
Modify the script above to print `Hello World` instead of `$x $y`.

??? Solution

Modify `println '$x + $y'` to `println "$x + $y"`.
Modify `println '$x $y'` to `println "$x $y"`.

```groovy linenums="1" title="snippet.nf"
foxtype = 'quick'
Expand All @@ -283,7 +283,7 @@ $x + $y

x = 'Hello'
y = 'World'
println "$x + $y"
println "$x $y"
```

Finally, string literals can also be defined using the `/` character as a delimiter. They are known as **slashy** strings and are useful for defining regular expressions and patterns, as there is no need to escape backslashes. As with double-quote strings they allow to interpolate variables prefixed with a `$` character.
Expand Down

0 comments on commit 1d20964

Please sign in to comment.