set

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.3)
operator fun set(index: Int, value: T)
For Common, JVM, JS

Sets the array element at the specified index to the specified value. This method can be called using the index operator.

arr[index] = value

If the index is out of bounds of this array, throws an IndexOutOfBoundsException except in Kotlin/JS where the behavior is unspecified.

For Native

Sets the array element at the specified index to the specified value. This method can be called using the index operator.

arr[index] = value

If the index is out of bounds of this array, throws an IndexOutOfBoundsException.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/set.html