Convert a HashSet<T> to an array in .NET

Viewed 41252

How do I convert a HashSet<T> to an array in .NET?

4 Answers

Now you can do it even simpler, with List<T> constructor (Lists are modern Arrays :). E. g., in PowerShell:

$MyNewArray = [System.Collections.Generic.List[string]]::new($MySet)
Related