Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Múltiples líneas con salto de línea
- assert '''hello,
- world''' == 'hello,\nworld'
- // Múltiples líneas sin salto de línea
- assert 'hello, \
- world' == 'hello, world'
- // También con triples dobles comillas
- def text = """\
- Good morning. \
- Good night again."""
- assert text == "Good morning. Good night again."
- // Sustitución de variables con dobles comillas
- def name = 'Groovy'
- assert "hello $name, how are you today?" == "hello Groovy, how are you today?"
- def a = 'How are you?'
- assert "The phrase '$a' has length ${a.size()}" ==
- "The phrase 'How are you?' has length 12"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement