each()'s Examples

each() method, which iterates over the elements of the Iterable Interface.

task groovyJDK << {

String myName = "Marc"; myName.each()

{

println "${it}"

};

}

C:\> gradle –q groovyJDK

output:When you execute the above code, you should see the following output − M a r c

myName.each() { 
    println "${it}" 
   };

DevOpsSchool
Typically replies within an hour

DevOpsSchool
Hi there 👋

How can I help you?
×
Chat with Us