- Home /
Can't remember how list.addrange goes
Hi everyone, I can't remember how the list.addrange arguments go. I tried typing in examplelist.addrange(0,5) but I don't think that's right because i get this error no overload for method AddRange takes 2 arguments. Sorry for asking this simple question but I couldn't find an example anywhere.
Answer by Eric5h5 · Sep 27, 2012 at 05:29 AM
How about looking it up in the docs?
I did that, but I didn't see any lines that used addrange.Which is what I'm looking for.
I did look up the docs but I didn't find anything helpful. I simply want to add a range of 0-5 but the docs don't say or show how to do that.
Right at the top, it says "Adds the elements of the specified collection to the end of the List." Then there's a code example, which includes the line "dinosaurs.AddRange(dinosaurs);" (If you don't immediately see it, web browsers do have a "search within the page" feature.)
I thought addrange added a range of elements to a list. What should I do now? I don't want to add a collection to the end of a line.
Your answer
