using System.Collections.Generic;
using System.Linq;

namespace SharpAgent.Core.Extensions
{
    public static class EnumerableExtensions
    {
        public static string SelectJoinedString<T>(this IEnumerable<T> items, string separator = ",")
        {
            return string.Join(separator, items.Select(x =>
            {
                if (x != null) return x.ToString();
                return string.Empty;
            }).ToArray());
        }
    }
}