Sha256: b578dd1225eb3521125081d6b668b78899e04e173231dffe6138f22844723acd
Contents?: true
Size: 569 Bytes
Versions: 263
Compression:
Stored size: 569 Bytes
Contents
using System.Collections; public static class Flattener { public static IEnumerable Flatten(IEnumerable input) { foreach (var element in input) { var enumerable = element as IEnumerable; if (enumerable != null) { foreach (var flattenedElement in Flatten(enumerable)) { yield return flattenedElement; } } else if (element != null) { yield return element; } } } }
Version data entries
263 entries across 263 versions & 1 rubygems