Skip to content

Interleave irregular enumerables with circular strategy #89

@GoogleCodeExporter

Description

@GoogleCodeExporter
result: !a1!b2!c3!a4!b5!c1!a2!b3!c4!a5!b1!c2!a3!b4!c5!a1... (Hope I got that 
right, you get the idea). The length of the IEnumerables is unknown of course 
and the result should be lazy-evaluated.

There may already be a way to do this but I didn't see anything obvious like 
this:

public static IEnumerable<T> Interleave<T>(params IEnumerable<T>[] 
sequencesToInterleave)
{
 ... 
}

foreach (var item in Interleave(new string[] { "!" }, new string[] { "a", "b", 
"c" }, new string[] { "1", "2", "3", "4", "5" }))
{
                    Console.Write(item.ToString());
}


Original issue reported on code.google.com by virtan...@gmail.com on 9 May 2014 at 12:18

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions