List 数组用逗号分隔成字符串 var ptCancelFileUpload = context.PtCancelFileUpload.Where(x => x.Recordstatus != RecordStatusType.InActive.ToStr()).Select(x => x.Taskcode).ToList();if (ptCancelFileUpload.Count > 0){string resultStr = "";foreach (var item in ptCancelFileUpload){resultStr += item + ",";}resultStr = resultStr.Remove(resultStr.Length - 1, 1);//删除最后一位字符} 字符串用逗号分隔存到List 数组 var code = "CMZ1-32,CMZ1-33,"; List<string> taskcodelist = new List<string>(); string[] nametk = null; nametk = code.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); taskcodelist = new List<string>(nametk);