METHOD

Enumerable.ToArray

Materializes a sequence into array storage. Reference elements are not cloned.

Formal Syntax & Structure

csharp syntaxcsharp
T[] ToArray<T>(IEnumerable<T> source)

Working Example

Example Snippetcsharp
using System;using System.Linq;int[] snapshot = new[] {1,2}.Where(n=>n>1).ToArray();
C# & .NET Reference