如何循环遍历值列表,包括每个值到Groovy多行字符串?
myList = ['one', 'two', 'three']
myString = """
some text
${for(item in myList){item}}
some more text
"""
答案 0 :(得分:1)
使用static void main(String[] args) {
def myList = ['one', 'two', 'three']
def myString = """
some text
${myList.join()}
some more text
"""
println myString
}
//a[contains(.,'6017785')]