Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-92

Groovy Strings don't support +=

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-2
    • 1.0-beta-3
    • None
    • None

    Description

      Groovy Strings don't support +=

      For example, this doesn't work:
      a = "dog"
      b = "${a}"
      b += " cat"

      Instead, toString() must be called on the GString first:
      a = "dog"
      b = "${a}".toString()
      b += " cat"

      Attachments

        Activity

          People

            jstrachan James Strachan
            rodcope Rod Cope
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: