473,695 Members | 2,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(IEnumerabl e
a,IEnumerable b)
Nov 17 '05 #1
5 5187
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(IEnumerabl e
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.co m>
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.co m> schrieb im Newsbeitrag
news:MP******** *************** *@msnews.micros oft.com...
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(IEnumerabl e
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.co m>
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> JoinTwoEnumerat ors(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******** ******@TK2MSFTN GP15.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.co m> schrieb im Newsbeitrag
news:MP******** *************** *@msnews.micros oft.com...
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(IEnumerabl e
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.co m>
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
2065
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 imagine that there is a tool which handles this task automatically. In other words it should copy the text between <BODY> and </BODY> and paste it just before the end </BODY> tag of the other web page. Furthermore it could copy possibly existing...
9
1873
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 since I'm asking in the first place, assume that assumption to be very assuming. thanks, Eric
2
3848
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 different database; *eg. MyTable* from *Friends.mdb* and *Foes.mdb* respectively. Is that achievable? I do hope anyone here can enlighten me on this one because I am really a newbie in using Access DB and also I'm using *ASP* in this project. Hope...
5
5876
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? Thx for help, Paul
5
3024
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 unable to get it to work. I dont know the correct syntac wher I have put the word 'PLUS'. <?php $_SESSION = $_SESSION PLUS $_POST;?> I have tried & but this doesnt work, or even && which I have seen in some
1
1737
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 can i change these types so i can join the columns together as string? thanks
3
2024
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:" & " " & & " " & "Time:" & " " &
2
2259
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 PL_Input.Date_ID,Count(PL_Input.+PL_Input.+PL_Input.+PL_Input.+PL_Input.) AS FROM Country INNER JOIN PL_Input ON Country.Country_ID = PL_Input.Country_ID WHERE (((. & "" & . & "" & . & "" & . & "" & .) Like "*2*"))
8
2448
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 write a query that will ultimately give me the values of the second table, merged together as follows: Data One, Data Two
3
1570
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 of many projects. (One statement counts the number of open projects, one counts the number of completed projects, and the third one counts the number of late projects.) The count operations use GROUP BY project to operate. An example of one of...
0
8631
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8984
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8825
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7661
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6491
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5839
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4340
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
1976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.