Groovy web console

subscribe to the feed Subscribe
to this
site

iterate multiline string

Published 3 months ago by dagget
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def tags = '''
aaa
bbb
ccc
'''

def found = tags.readLines().find{tag->
    return "BBB" ==  tag.toUpperCase()
}

println "found: ${found}"