string Join

string tys = "";
            for (int i = 0; i < typeList.Count; i++)
            {
                if (typeList[i] != -1)
                {
                    tys = typeList[i] + ",";
                }
                else
                {
                    tys = "";
                    break;
                }
            }
            tys = tys.TrimEnd(',');

            tys = typeList.Contains(-1)?"":string.Join(",",typeList);
View Code
收藏
关注
评论
原文地址:https://www.cnblogs.com/yidengbone/p/7675993.html