Appending (lists)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • csharpula csharp

    Appending (lists)

    Hello,
    I would like to add a content of two following lists values to one
    mutual list of List<ClassC:

    List<ClassA+ List<ClassB//when classA and classB inherit from mutual
    classC

    How can I do it in c#?

    Thank you!



    *** Sent via Developersdex http://www.developersdex.com ***
  • Peter Duniho

    #2
    Re: Appending (lists)

    On Sun, 26 Oct 2008 05:06:39 -0700, csharpula csharp <csharpula@yaho o.com>
    wrote:
    Hello,
    I would like to add a content of two following lists values to one
    mutual list of List<ClassC:
    >
    List<ClassA+ List<ClassB//when classA and classB inherit from mutual
    classC
    >
    How can I do it in c#?
    You may find the List<T>.AddRang e() method useful. Of course, you could
    always just enumerate both lists explicitly, adding each element as you go.

    It seems to me that the general approach to adding elements to lists
    should be clear enough from the documentation, so if there's something
    less obvious you're having trouble with, you should try to be more
    specific in your question.

    Pete

    Comment

    Working...