Answers for "Disctionary to Array"

0

Disctionary to Array

// dict is Dictionary<string, Foo>

Foo[] foos = new Foo[dict.Count];
dict.Values.CopyTo(foos, 0);

// or in C# 3.0:
var foos = dict.Values.ToArray();
Posted by: Guest on October-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language