disctionary to array

Solutions on MaxInterview for disctionary to array by the best coders in the world

showing results for - "disctionary to array"
Alberto
06 Oct 2020
1// dict is Dictionary<string, Foo>
2
3Foo[] foos = new Foo[dict.Count];
4dict.Values.CopyTo(foos, 0);
5
6// or in C# 3.0:
7var foos = dict.Values.ToArray();
8