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

eachLine should support a 2 arg closure with index being second arg

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5.4
    • 1.5.5, 1.6-beta-1
    • groovy-jdk
    • None

    Description

      It would be good to be able to support an index on eachLine as follows:

      file.eachLine { line, count -> println "$count > $line" }
      

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: