473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

joining IEnumerables together

Hi, I have multiple Collections which I want to iterate over *without*
copying alle my collections into one.

If there is no method to do this I propose a new Class Enumerate which
should provide something like that: IEnumerable Join(IEnumerable
a,IEnumerable b)
Nov 17 '05 #1
5 5177
cody <de********@gmx.de> wrote:
Hi, I have multiple Collections which I want to iterate over *without*
copying alle my collections into one.

If there is no method to do this I propose a new Class Enumerate which
should provide something like that: IEnumerable Join(IEnumerable
a,IEnumerable b)


That's very easy to write - I suggest you try it and see how useful it
is for you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
Yes writing that kind of functionality is not a problem but it would be
great if the framework would provide such a thing, just because I don't like
always having to reinvent the wheel.
"Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb im Newsbeitrag
news:MP************************@msnews.microsoft.c om...
cody <de********@gmx.de> wrote:
Hi, I have multiple Collections which I want to iterate over *without*
copying alle my collections into one.

If there is no method to do this I propose a new Class Enumerate which
should provide something like that: IEnumerable Join(IEnumerable
a,IEnumerable b)


That's very easy to write - I suggest you try it and see how useful it
is for you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 17 '05 #3
In 2.0 this becomes trivial:

public IEnumerable<T> JoinTwoEnumerators(IEnumerable<T> first,
IEnumerable<T> second)
{
foreach (T t in first)
{
yield return t;
}

foreach (T t in second)
{
yield return t;
}
}
"cody" <de********@gmx.de> wrote in message
news:eI**************@TK2MSFTNGP15.phx.gbl...
Yes writing that kind of functionality is not a problem but it would be
great if the framework would provide such a thing, just because I don't
like always having to reinvent the wheel.
"Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb im Newsbeitrag
news:MP************************@msnews.microsoft.c om...
cody <de********@gmx.de> wrote:
Hi, I have multiple Collections which I want to iterate over *without*
copying alle my collections into one.

If there is no method to do this I propose a new Class Enumerate which
should provide something like that: IEnumerable Join(IEnumerable
a,IEnumerable b)


That's very easy to write - I suggest you try it and see how useful it
is for you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Nov 17 '05 #4

public IEnumerable<T> JoinEnumerators(params IEnumerable<T>[] enums) {
foreach ( IEnumerator enum in enums )
foreach ( T t in enum )
yield return t;
}

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-
Nov 17 '05 #5

public IEnumerable<T> JoinEnumerators(params IEnumerable<T>[] enums) {
foreach ( IEnumerator enum in enums )
foreach ( T t in enum )
yield return t;
}

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wladimir Borsov | last post by:
I am searching for tool which joins the content of two (or more) HTML web pages together into a new target HTML page. O.k. I could do this manually but this is rather unconvenient. I could...
9
by: Eric Sabine | last post by:
Can someone give me a practical example of why I would join threads? I am assuming that you would typically join a background thread with the UI thread and not a background to a background, but...
2
by: Coquette | last post by:
Hi all. I'm new here. I wanted to ask your opinion about *joining two tables* from *two different database* together. Is *that* possible? My project requires me to join identical tables from...
5
by: Paul Czubilinski | last post by:
Hello, I would like to join few pdf files uploaded separetly into my website into one downloable pdf file. Is it possible in php or is it neccessary to download all these files one by one? ...
5
by: Ian Davies | last post by:
Hello I am trying to update a session, ie everytime the page is resubmitted I want the current selected value from a list to be appended to the old session value. I have the following code but am...
1
by: s99999999s2003 | last post by:
hi i have some databse results that are NoneType and DateTimeType. now i have trouble joining these row results together like "|".join(result) as it says cannot join NoneType , DateTimeType . How...
3
by: atiq | last post by:
I am tyring to join two join fields together in a Report in the follwoing format: Date: Time: i have attempted this using the following code, but doesnt work: ="Date:" & " " & & " " &...
2
by: Supermansteel | last post by:
I am joining these 2 tables together in Access 2003 and can't figure out the exact way of writing this script......Can anyone help? I have the following SQL: SELECT...
8
by: MGM | last post by:
This is a bit hard to explain but I'll try my best. I have 2 tables. One table has a row with the following value: 2,3 The two numbers are both ID's that are in the second table. I need to...
3
by: nickvans | last post by:
Hello everyone, I am new to SQL Server, and am having trouble joining several SELECT statements together. I have three SQL Select statements that do separate count operations to get the status...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.