Groovy Array Length - Grails Cookbook

PHOTO EMBED

Tue Jun 23 2020 10:07:09 GMT+0000 (Coordinated Universal Time)

Saved by @givemekey

String[] test = ["Apple", "Banana", "Carrots"] 
def arrayLength = test.size()
def arrayLength = test.length
println "The length of the array is: " + arrayLength
content_copyCOPY

http://grails.asia/groovy-array-length