I am looking for a one liner that transforms List into object[]. It\'s one liner, so I am not interested in solutions such as foreac
List
object[]
foreac
In C# on .NET 2.0 (VS 2008) the following compiles and doesn't use LINQ (as far as I can see) for reference types.
object[] oArray; List oList = new List(); oArray = oList.ToArray();
This does not require a cast as all reference types have object as their base.