List<string> djbhList = new List<string>(); djbhList.Add("JRKBZF00000151"); djbhList.Add("JRKZDA00000152"); djbhList.Add("JRKZDA00000153"); //此方法 string.Join(",", djbhList.ToArray()); //得到结果为 //"JRKBZF00000151,JRKZDA00000152,JRKZDA00000153" //此方法 string.Join(",", djbhList.Select(x => "'" + x + "'").ToArray()); //得到结果为 //"'JRKBZF00000151','JRKZDA00000152','JRKZDA00000153'"
从网易博客(http://cxwstar.blog.163.com/blog/static/48468763201572777423/)迁移,原发表于2015年8月27日.