Array.Fill Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Fill<T>(T[], T) |
Assigns the given |
Fill<T>(T[], T, Int32, Int32) |
Assigns the given |
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.
- count
- Int32
The number of elements to copy.