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#
40 lines
822 B
C#
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;
|
|
|
|
try
|
|
{
|
|
foreach (var item in data)
|
|
{
|
|
if (resStr != "")
|
|
resStr += ",";
|
|
|
|
if (item is string)
|
|
{
|
|
resStr += item;
|
|
}
|
|
else
|
|
{
|
|
resStr += item.ToString();
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
throw;
|
|
}
|
|
|
|
|
|
return resStr;
|
|
}
|
|
} |