Suggestion for RemoveEmptyElements

Aug 6, 2008 at 6:06 PM
public static IEnumerable<string> RemoveEmptyElements(this IEnumerable<string> strings)
{
    foreach (var s in strings)
    {
        if (!string.IsNullOrEmpty(s))
        {
            yield return s;
        }
    }
}

It's (outwardly) simpler, and maintains the IEnumerable nature of the input.

Coordinator
Aug 14, 2008 at 5:37 PM
I like the idea. Changed and checked-in.