C#字符串

1、

List list=new  List
var cd = list.Select(s=>new { s.idCard, s.id });
             string id = "";
            string idCard = "";
             foreach (var item in cd)
            {
                id +=item.id+",";
                idCard +=item.idCard+",";
             }
             id = id.Substring(0, id.Length - 1);
             idCard = idCard.Substring(0, idCard.Length - 1);
             string[] strArr;
             strArr =   id.Split(',') ;

            return strArr;

 

你可能感兴趣的:(c#,C#)