W3cubDocs

/Kotlin

elementAt

inline fun <T> Array<out T>.elementAt(index: Int): T
inline fun ByteArray.elementAt(index: Int): Byte
inline fun ShortArray.elementAt(index: Int): Short
inline fun IntArray.elementAt(index: Int): Int
inline fun LongArray.elementAt(index: Int): Long
inline fun FloatArray.elementAt(index: Int): Float
inline fun DoubleArray.elementAt(index: Int): Double
inline fun BooleanArray.elementAt(index: Int): Boolean
inline fun CharArray.elementAt(index: Int): Char

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

fun <T> Iterable<T>.elementAt(index: Int): T

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this collection.

inline fun <T> List<T>.elementAt(index: Int): T

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this list.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/element-at.html