Forum Discussion
M_McDonald
16 years agoSuper Contributor
Assuming that there are the same number of items in each string, how about this:
def planNames = "Plan1,Plan2".split(",")
def quotas = "20,30".split(",")
def p = "<Plans>\n"
for (i in 0..planNames.size()-1) {
p += "<PlanName>${planNames[i]}</PlanName>\n<QuotaSize>${quotas[i]}</QuotaSize>\n"
}
p += "</Plans>"
log.info p