Groovy: join elements of an array
examples/groovy/join_elements.groovy
def names = ['Foo', 'Bar', 'Zorg'] def names_str = names.join('-') println(names_str) println( names.join(' ') ) println( names.join('\n') )
The output is:
examples/groovy/join_elements.txt
Foo-Bar-Zorg Foo Bar Zorg Foo Bar Zorg
Published on 2019-04-17
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post