using System; using System.Collections; using System.Collections.Generic; namespace Plane.Collections { public static class EnumerableExtensions { public static void ForEach(this IEnumerable items, Action action) { if (items == null) { throw new ArgumentNullException(nameof(items)); } if (action == null) { throw new ArgumentNullException(nameof(action)); } foreach (T item in items) { action(item); } } public static void ForEach(this IEnumerable items, Action action) { if (items == null) { throw new ArgumentNullException(nameof(items)); } if (action == null) { throw new ArgumentNullException(nameof(action)); } foreach (var item in items) { action(item); } } public static string JoinToString(this IEnumerable items, string separator) { if (items == null) { throw new ArgumentNullException(nameof(items)); } return string.Join(separator, items); } public static string JoinToString(this IEnumerable items, string separator) { if (items == null) { throw new ArgumentNullException(nameof(items)); } return string.Join(separator, items); } } }