What is the best way to convert a List of primitive longs to an array of strings?
I think I'm looking for something fancier than writing my own loop, etc..
What is the best way to convert a List of primitive longs to an array of strings?
I think I'm looking for something fancier than writing my own loop, etc..
This should do the trick:
string[] arr = list.Select(l => l.ToString()).ToArray();
This is worth checking against the performance of a select statement.
string[] result = Array.ConvertAll(list.ToArray(), i => i.ToString());