foreach (long taskid in tasks) { if (flowids.Length > 0) flowids += "," + taskid.ToString(); else flowids += taskid.ToString(); }