# Array.FillArray.FillArray.FillArray.Fill Method

## 多載

 Fill(T[], T) Fill(T[], T) Fill(T[], T) Fill(T[], T) 將型別為 `T` 的給定 `value`，指派至所指定 `array` 的每個元素。Assigns the given `value` of type `T` to each element of the specified `array`. Fill(T[], T, Int32, Int32) Fill(T[], T, Int32, Int32) Fill(T[], T, Int32, Int32) Fill(T[], T, Int32, Int32) 將型別為 `T` 的給定 `value`，指派至所指定 `array` 的元素，範圍從 `startIndex` (包含) 到下一個 `count` 數目的索引。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)Fill<T>(T[], T)Fill<T>(T[], T)Fill<T>(T[], T)

``````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)``

T

array
T[]

value
T T T T

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

``````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)``

T

#### 參數

array
T[]

value
T T T T

startIndex
Int32 Int32 Int32 Int32

32 位元整數，代表 Array 中的索引，由此開始填入。A 32-bit integer that represents the index in the Array at which filling begins.

count
Int32 Int32 Int32 Int32