Is there a way to convert a List(of Object)
to a List(of String)
in c# or vb.net without iterating through all the items? (Behind the scenes iteration is fine – I just want concise code)
Update:
The best way is probably just to do a new select
myList.Select(function(i) i.ToString()).ToList();
or
myList.Select(i => i.ToString()).ToList();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…