齐河县工程建设监理有限公司网站,wordpress登录返回,郑州做网站怎么样,网站建设面板有时候拼接SQL语句时#xff0c;可能会需要将list中的元素都加上单引号#xff0c;并以逗号分开#xff0c;但是Join只能简单的分开#xff0c;没有有单引号#xff01;
1.第一种拼接方案
Liststring arrIds new Liststring();
arrIds.Add(aa可能会需要将list中的元素都加上单引号并以逗号分开但是Join只能简单的分开没有有单引号
1.第一种拼接方案
Liststring arrIds new Liststring();
arrIds.Add(aa);
arrIds.Add(bb);
arrIds.Add(cc); ;
string arrIdsed string.Join(,, arrIds.Select( i i ));
Console.WriteLine(arrIdsed);
2.第二种解决方案
StringBuilder builder new StringBuilder();
builder.Append();
Liststring arrIds new Liststring();
arrIds.Add(aa);
arrIds.Add(bb);
arrIds.Add(cc); ;
string arrIdsed string.Join(,, arrIds);
builder.Append(arrIdsed).Append();
Console.WriteLine(builder);