Edit

Share via


Array.Fill Method

Definition

Overloads

Fill<T>(T[], T)

Assigns the given value of type T to each element of the specified array.

Fill<T>(T[], T, Int32, Int32)

Assigns the given value of type T to the elements of the specified array which are within the range of startIndex (inclusive) and the next count number of indices.

Fill<T>(T[], T)

Source:
Array.cs
Source:
Array.cs
Source:
Array.cs

Assigns the given value of type T to each element of the specified array.

public:
generic <typename T>
 static void Fill(cli::array <T> ^ array, T value);
public static void Fill<T> (T[] array, T value);
static member Fill : 'T[] * 'T -> unit
Public Shared Sub Fill(Of T) (array As T(), value As T)

Type Parameters

T

The type of the elements in the array.

Parameters

array
T[]

The array to be filled.

value
T

The value to assign to each array element.

Applies to

Fill<T>(T[], T, Int32, Int32)

Source:
Array.cs
Source:
Array.cs
Source:
Array.cs

Assigns the given value of type T to the elements of the specified array which are within the range of startIndex (inclusive) and the next count number of indices.

public:
generic <typename T>
 static void Fill(cli::array <T> ^ array, T value, int startIndex, int count);
public static void Fill<T> (T[] array, T value, int startIndex, int count);
static member Fill : 'T[] * 'T * int * int -> unit
Public Shared Sub Fill(Of T) (array As T(), value As T, startIndex As Integer, count As Integer)

Type Parameters

T

The type of the elements of the array.

Parameters

array
T[]

The Array to be filled.

value
T

The new value for the elements in the specified range.

startIndex
Int32

A 32-bit integer that represents the index in the Array at which filling begins.

count
Int32

The number of elements to copy.

Applies to