Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GStrings (double quotes) support interpolation
- // Interpolation is the act of replacing a placeholder in a string with a
- // value when the string is evaluated. A placeholder is surrounded by ${}
- // or prefixed with $.
- def name = 'World'
- println "Hello $name"
- // There are also multi-line strings
- def text = '''This is a long text that
- spans multiple lines.'''
- // ... and GStrings
- name = 'user'
- text = """Hello $name!
- $text"""
- println(text)
Add Comment
Please, Sign In to add comment