def names = ["myname", "yourname", "theirname", "allnames"]
String n = ""
names.each{
n += it + ","
}
println n
Output:
myname,yourname,theirname,allnames,
How do I get rid of the leading comma
def names = ["myname", "yourname", "theirname", "allnames"]
String n = ""
names.each{
n += it + ","
}
println n
Output:
myname,yourname,theirname,allnames,
How do I get rid of the leading comma