Cast Dictionary KeyCollection to String array

.net, c#, c#-3.0, dictionary, linq

Solution

How about this...

String.Join(",", myDic.Keys.Select(o=>o.ToString()).ToArray());

Problem

I have a `Dictionary<int, string>` which I want to take the Key collection into a CSV string. I planned to do: ``` String.Join(",", myDic.Keys.ToArray().Cast<string[]>()); ``` The cast is failing though. Thanks

Original source