I am looking for a one liner that transforms List<T>
into object[]
. It's one liner, so I am not interested in solutions such as foreach
, or for
...
Any takers?
Hint: No, both List<T>.ToArray()
and List<T>.ToArray<object>()
don't work.
Edit: Why List<T>.ToArray<object>()
doesn't work? Because it can't compile.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…