Array.AsReadOnly<T>(T[]) Method

Definition

Returns a read-only wrapper for the specified array.

public:
generic <typename T>
 static System::Collections::ObjectModel::ReadOnlyCollection<T> ^ AsReadOnly(cli::array <T> ^ array);
public static System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly<T>(T[] array);
static member AsReadOnly : 'T[] -> System.Collections.ObjectModel.ReadOnlyCollection<'T>
Public Shared Function AsReadOnly(Of T) (array As T()) As ReadOnlyCollection(Of T)

Type Parameters

T

The type of the elements of the array.

Parameters

array
T[]

The one-dimensional, zero-based array to wrap in a read-only ReadOnlyCollection<T> wrapper.

Returns