Aggregate 为字符串数组元素添加单引号 可用于SQL数据查询 in

string condition = string.Empty;
int[] a = { 12131415 };
condition 
= a.Aggregate(condition, (current, i) => current + ("'" + i+"',")).Trim(',');
this.Text = condition;
 
输出结果为:'12','13','14','15'
原文地址:https://www.cnblogs.com/pato/p/1984560.html