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.
36 lines
732 B
C#
36 lines
732 B
C#
10 months ago
|
namespace DS.Module.Core;
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
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;
|
||
|
foreach (var item in data)
|
||
|
{
|
||
|
if (resStr != "")
|
||
|
{
|
||
|
resStr += ",";
|
||
|
}
|
||
|
|
||
|
if (item is string)
|
||
|
{
|
||
|
resStr += item;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
resStr += item.Value;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
return resStr;
|
||
|
}
|
||
|
}
|