将列表转换成字符串

public static string ListToString(IList<string> stringList)
        {
            string result = "";
            if (stringList != null)
            {
                foreach (string value in stringList)
                {
                    result += "'" + value.Trim() + "',";
                }
            }
            if (!string.IsNullOrEmpty(result))
            {
                result = result.Remove(result.Length - 1, 1);
            }
            return result;
        }

 

上一篇:js常用通用函数


下一篇:宿舍系统增加学生信息