Aggregate 为字符串数组元素添加单引号 可用于SQL数据查询 in
string condition = string.Empty;
int[] a = { 12, 13, 14, 15 };
condition = a.Aggregate(condition, (current, i) => current + ("'" + i+"',")).Trim(',');
this.Text = condition;
int[] a = { 12, 13, 14, 15 };
condition = a.Aggregate(condition, (current, i) => current + ("'" + i+"',")).Trim(',');
this.Text = condition;
输出结果为:'12','13','14','15'