2023-03-08 09:33:11 +01:00

20 lines
584 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ReportViewer
{
public static class Extensions
{
public static string JoinString(this IEnumerable<string>? list, string separator = ",")
{
if (list == null)
throw new ArgumentNullException(nameof(list));
return list.Aggregate(new StringBuilder(), (current, next) =>
current.Append(current.Length == 0 ? string.Empty : separator).Append(next)).ToString();
}
}
}