VB.NET program that uses ToArray
' Create an IEnumerable range.
' This is not an array.
Dim e As IEnumerable(Of Integer) = Enumerable.Range(0, 10)
' Use ToArray extension to convert to an array.
Dim array() As Integer = e.ToArray()
' Display elements.
For Each i As Integer In array
Internals. I investigated the ToArray extension Function. It is located within System.Core.dll in the .NET Framework's folder. I opened this file with IL Disassembler.IL Disassembler
Info: This Function allocates a new array. It then calls into Array.Copy. This newly-allocated array is returned to the calling Function.