fill

expect fun <T> Array<T>.fill(element: T, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size)(source)
expect fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size)(source)

Fills this array or its subrange with the specified element value.

Since Kotlin

1.0

Parameters

fromIndex

the start of the range (inclusive) to fill, 0 by default.

toIndex

the end of the range (exclusive) to fill, size of this array by default.

Throws

if fromIndex is less than zero or toIndex is greater than the size of this array.