using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SiwiFms.Helper
{
public static class ListStringExtensin
{
///
/// 转换为逗号隔开的字符串
///
///
///
public static string ToArrayString(this List list,string jg = ",")
{
if (list.Count == 0) return "";
string returnstr = "";
foreach (string str in list)
{
if (str == null||string.IsNullOrWhiteSpace(str)) continue;
returnstr += (str + jg);
}
if (returnstr.Length == 0)
{
return returnstr;
}
else
{
return returnstr.Substring(0, returnstr.Length - jg.Length);
}
}
public static object[] ToArrayObject(this List list) {
object[] objs = new object[] { };
if (list.Count == 0) return objs;
return list.ToArray();
}
}
}