You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
822 B
C#

10 months ago
namespace DS.Module.Core;
public static class GenericHelper
{
/// <summary>
/// 把数组转为逗号连接的字符串
/// </summary>
/// <param name="data"></param>
/// <param name="Str"></param>
/// <returns></returns>
public static string ArrayToString(dynamic data, string Str)
{
string resStr = Str;
10 months ago
try
{
foreach (var item in data)
{
if (resStr != "")
resStr += ",";
10 months ago
if (item is string)
{
resStr += item;
}
else
{
resStr += item.ToString();
}
}
}
catch
{
throw;
}
return resStr;
}
10 months ago
}