Re: ToArray() ?
- From: "Daniel O'Connell [C# MVP]" <onyxkirx@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Jun 2005 15:09:26 -0500
"Peter Kirk" <pk@xxxxxxxxxxxxxxxxxx> wrote in message
news:u0yawFMbFHA.1404@xxxxxxxxxxxxxxxxxxxxxxx
> Hi
>
> I call a method which returns an IList containing a list of one type of
> object. How do I best convert this IList to an array?
>
You can load it into an ArrayList and uses ArrayLists.ToArray() if you
aren't worried about performance, otherwise I'd recommend writing a ToArray
implemetnation that takes an IList. Its not terribly hard to do, especially
if you know the type the list is going to be at all times.
.
- References:
- ToArray() ?
- From: Peter Kirk
- ToArray() ?
- Prev by Date: Re: "Object does not match target type." using dynamic compiling &
- Next by Date: Re: C# very optimisation
- Previous by thread: Re: ToArray() ?
- Next by thread: Naming conventions?
- Index(es):
Relevant Pages
|