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

Provide last() and first() implementations on Object []

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.2
    • 1.7.3, 1.8-beta-1
    • groovy-jdk
    • None

    Description

      I wanted to standardize on last() for our collections instead of [-1] which is somewhat less readable. Unfortunately last() is not defined on Object [] so I could not use it after splitting a string. It would be cool to have last() and first() on arrays too.

      Attachments

        1. groovy-4233.patch
          3 kB
          Luis Arias

        Activity

          People

            guillaume Guillaume Sauthier
            kaaloo Luis Arias
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: