Array

class Array<T>

Represents an array (specifically, a Java array when targeting the JVM platform). Array instances can be created using the arrayOf, arrayOfNulls and emptyArray standard library functions. See Kotlin language documentation for more information on arrays.

class Array<T>

Represents an array (specifically, a Java array when targeting the JVM platform). Array instances can be created using the arrayOf, arrayOfNulls and emptyArray standard library functions. See Kotlin language documentation for more information on arrays.

class Array<T>

Represents an array. Array instances can be created using the constructor, arrayOf, arrayOfNulls and emptyArray standard library functions. See Kotlin language documentation for more information on arrays.

Constructors

Link copied to clipboard
fun <T> Array(size: Int, init: (Int) -> T)

Creates a new array with the specified size, where each element is calculated by calling the specified init function.

fun <T> Array(size: Int, init: (Int) -> T)

Creates a new array with the specified size, where each element is calculated by calling the specified init function.

fun <T> Array(size: Int, init: (Int) -> T)

Creates a new array with the specified size, where each element is calculated by calling the specified init function.

Functions

Link copied to clipboard
operator fun get(index: Int): T

Returns the array element at the specified index. This method can be called using the index operator.

operator fun get(index: Int): T

Returns the array element at the specified index. This method can be called using the index operator.

operator external fun get(index: Int): T

Returns the array element at the specified index. This method can be called using the index operator.

Link copied to clipboard
operator fun iterator(): Iterator<T>

Creates an Iterator for iterating over the elements of the array.

operator fun iterator(): Iterator<T>

Creates an Iterator for iterating over the elements of the array.

operator fun iterator(): Iterator<T>

Creates an Iterator for iterating over the elements of the array.

Link copied to clipboard
operator fun set(index: Int, value: T)

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

operator fun set(index: Int, value: T)

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

operator external fun set(index: Int, value: T)

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

Properties

Link copied to clipboard
val size: Int

Returns the number of elements in the array.

val size: Int

Returns the number of elements in the array.

val size: Int

Returns the number of elements in the array.

Extensions

Link copied to clipboard
inline fun <T> Array<out T>.all(predicate: (T) -> Boolean): Boolean
inline fun <T> Array<out T>.all(predicate: (T) -> Boolean): Boolean
inline fun <T> Array<out T>.all(predicate: (T) -> Boolean): Boolean

Returns true if all elements match the given predicate.

Link copied to clipboard
fun <T> Array<out T>.any(): Boolean
fun <T> Array<out T>.any(): Boolean
fun <T> Array<out T>.any(): Boolean

Returns true if array has at least one element.

inline fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean
inline fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean
inline fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean

Returns true if at least one element matches the given predicate.

Link copied to clipboard
fun <T> Array<out T>.asIterable(): Iterable<T>
fun <T> Array<out T>.asIterable(): Iterable<T>
fun <T> Array<out T>.asIterable(): Iterable<T>

Creates an Iterable instance that wraps the original array returning its elements when being iterated.

Link copied to clipboard
expect fun <T> Array<out T>.asList(): List<T>
expect fun <T> Array<out T>.asList(): List<T>
expect fun <T> Array<out T>.asList(): List<T>

Returns a List that wraps the original array.

actual fun <T> Array<out T>.asList(): List<T>
actual fun <T> Array<out T>.asList(): List<T>
actual fun <T> Array<out T>.asList(): List<T>

Returns a List that wraps the original array.

actual fun <T> Array<out T>.asList(): List<T>
actual fun <T> Array<out T>.asList(): List<T>
actual fun <T> Array<out T>.asList(): List<T>

Returns a List that wraps the original array.

actual fun <T> Array<out T>.asList(): List<T>
actual fun <T> Array<out T>.asList(): List<T>
actual fun <T> Array<out T>.asList(): List<T>

Returns a List that wraps the original array.

Link copied to clipboard
fun <T> Array<out T>.asSequence(): Sequence<T>
fun <T> Array<out T>.asSequence(): Sequence<T>
fun <T> Array<out T>.asSequence(): Sequence<T>

Creates a Sequence instance that wraps the original array returning its elements when being iterated.

Link copied to clipboard
inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>
inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>
inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>

Returns a Map containing key-value pairs provided by transform function applied to elements of the given array.

Link copied to clipboard
inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K, T>
inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K, T>
inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K, T>

Returns a Map containing the elements from the given array indexed by the key returned from keySelector function applied to each element.

inline fun <T, K, V> Array<out T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>
inline fun <T, K, V> Array<out T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>
inline fun <T, K, V> Array<out T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given array.

Link copied to clipboard
inline fun <T, K, M : MutableMap<in K, in T>> Array<out T>.associateByTo(destination: M, keySelector: (T) -> K): M
inline fun <T, K, M : MutableMap<in K, in T>> Array<out T>.associateByTo(destination: M, keySelector: (T) -> K): M
inline fun <T, K, M : MutableMap<in K, in T>> Array<out T>.associateByTo(destination: M, keySelector: (T) -> K): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given array and value is the element itself.

inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and and value is provided by the valueTransform function applied to elements of the given array.

Link copied to clipboard
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M

Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given array.

Link copied to clipboard
inline fun <K, V> Array<out K>.associateWith(valueSelector: (K) -> V): Map<K, V>
inline fun <K, V> Array<out K>.associateWith(valueSelector: (K) -> V): Map<K, V>
inline fun <K, V> Array<out K>.associateWith(valueSelector: (K) -> V): Map<K, V>

Returns a Map where keys are elements from the given array and values are produced by the valueSelector function applied to each element.

Link copied to clipboard
inline fun <K, V, M : MutableMap<in K, in V>> Array<out K>.associateWithTo(destination: M, valueSelector: (K) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> Array<out K>.associateWithTo(destination: M, valueSelector: (K) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> Array<out K>.associateWithTo(destination: M, valueSelector: (K) -> V): M

Populates and returns the destination mutable map with key-value pairs for each element of the given array, where key is the element itself and value is provided by the valueSelector function applied to that key.

Link copied to clipboard
@JvmName(name = "averageOfByte")
fun Array<out Byte>.average(): Double
@JvmName(name = "averageOfShort")
fun Array<out Short>.average(): Double
@JvmName(name = "averageOfInt")
fun Array<out Int>.average(): Double
@JvmName(name = "averageOfLong")
fun Array<out Long>.average(): Double
@JvmName(name = "averageOfFloat")
fun Array<out Float>.average(): Double
@JvmName(name = "averageOfDouble")
fun Array<out Double>.average(): Double
@JvmName(name = "averageOfByte")
fun Array<out Byte>.average(): Double
@JvmName(name = "averageOfShort")
fun Array<out Short>.average(): Double
@JvmName(name = "averageOfInt")
fun Array<out Int>.average(): Double
@JvmName(name = "averageOfLong")
fun Array<out Long>.average(): Double
@JvmName(name = "averageOfFloat")
fun Array<out Float>.average(): Double
@JvmName(name = "averageOfDouble")
fun Array<out Double>.average(): Double
@JvmName(name = "averageOfByte")
fun Array<out Byte>.average(): Double
@JvmName(name = "averageOfShort")
fun Array<out Short>.average(): Double
@JvmName(name = "averageOfInt")
fun Array<out Int>.average(): Double
@JvmName(name = "averageOfLong")
fun Array<out Long>.average(): Double
@JvmName(name = "averageOfFloat")
fun Array<out Float>.average(): Double
@JvmName(name = "averageOfDouble")
fun Array<out Double>.average(): Double

Returns an average value of elements in the array.

Link copied to clipboard
fun <T> Array<out T>.binarySearch(    element: T,     comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size): Int
fun <T> Array<out T>.binarySearch(    element: T,     comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size): Int
fun <T> Array<out T>.binarySearch(    element: T,     comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size): Int

Searches the array or the range of the array for the provided element using the binary search algorithm. The array is expected to be sorted according to the specified comparator, otherwise the result is undefined.

fun <T> Array<out T>.binarySearch(    element: T,     fromIndex: Int = 0,     toIndex: Int = size): Int
fun <T> Array<out T>.binarySearch(    element: T,     fromIndex: Int = 0,     toIndex: Int = size): Int
fun <T> Array<out T>.binarySearch(    element: T,     fromIndex: Int = 0,     toIndex: Int = size): Int

Searches the array or the range of the array for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.

Link copied to clipboard
inline operator fun <T> Array<out T>.component1(): T
inline operator fun <T> Array<out T>.component1(): T
inline operator fun <T> Array<out T>.component1(): T

Returns 1st element from the array.

Link copied to clipboard
inline operator fun <T> Array<out T>.component2(): T
inline operator fun <T> Array<out T>.component2(): T
inline operator fun <T> Array<out T>.component2(): T

Returns 2nd element from the array.

Link copied to clipboard
inline operator fun <T> Array<out T>.component3(): T
inline operator fun <T> Array<out T>.component3(): T
inline operator fun <T> Array<out T>.component3(): T

Returns 3rd element from the array.

Link copied to clipboard
inline operator fun <T> Array<out T>.component4(): T
inline operator fun <T> Array<out T>.component4(): T
inline operator fun <T> Array<out T>.component4(): T

Returns 4th element from the array.

Link copied to clipboard
inline operator fun <T> Array<out T>.component5(): T
inline operator fun <T> Array<out T>.component5(): T
inline operator fun <T> Array<out T>.component5(): T

Returns 5th element from the array.

Link copied to clipboard
operator fun <T> Array<out T>.contains(element: T): Boolean
operator fun <T> Array<out T>.contains(element: T): Boolean
operator fun <T> Array<out T>.contains(element: T): Boolean

Returns true if element is found in the array.

Link copied to clipboard
expect infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
expect infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
expect infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
expect infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
expect infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
expect infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are deeply equal to one another, i.e. contain the same number of the same elements in the same order.

@JvmName(name = "contentDeepEqualsInline")
actual infix inline fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
@JvmName(name = "contentDeepEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
@JvmName(name = "contentDeepEqualsInline")
actual infix inline fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
@JvmName(name = "contentDeepEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
@JvmName(name = "contentDeepEqualsInline")
actual infix inline fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
@JvmName(name = "contentDeepEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are deeply equal to one another, i.e. contain the same number of the same elements in the same order.

actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are deeply equal to one another, i.e. contain the same number of the same elements in the same order.

actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are deeply equal to one another, i.e. contain the same number of the same elements in the same order.

Link copied to clipboard
expect fun <T> Array<out T>.contentDeepHashCode(): Int
expect fun <T> Array<out T>?.contentDeepHashCode(): Int
expect fun <T> Array<out T>.contentDeepHashCode(): Int
expect fun <T> Array<out T>?.contentDeepHashCode(): Int
expect fun <T> Array<out T>.contentDeepHashCode(): Int
expect fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

@JvmName(name = "contentDeepHashCodeInline")
actual inline fun <T> Array<out T>.contentDeepHashCode(): Int
@JvmName(name = "contentDeepHashCodeNullable")
actual inline fun <T> Array<out T>?.contentDeepHashCode(): Int
@JvmName(name = "contentDeepHashCodeInline")
actual inline fun <T> Array<out T>.contentDeepHashCode(): Int
@JvmName(name = "contentDeepHashCodeNullable")
actual inline fun <T> Array<out T>?.contentDeepHashCode(): Int
@JvmName(name = "contentDeepHashCodeInline")
actual inline fun <T> Array<out T>.contentDeepHashCode(): Int
@JvmName(name = "contentDeepHashCodeNullable")
actual inline fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int
actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int
actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int
actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int
actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Link copied to clipboard
expect fun <T> Array<out T>.contentDeepToString(): String
expect fun <T> Array<out T>?.contentDeepToString(): String
expect fun <T> Array<out T>.contentDeepToString(): String
expect fun <T> Array<out T>?.contentDeepToString(): String
expect fun <T> Array<out T>.contentDeepToString(): String
expect fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

@JvmName(name = "contentDeepToStringInline")
actual inline fun <T> Array<out T>.contentDeepToString(): String
@JvmName(name = "contentDeepToStringNullable")
actual inline fun <T> Array<out T>?.contentDeepToString(): String
@JvmName(name = "contentDeepToStringInline")
actual inline fun <T> Array<out T>.contentDeepToString(): String
@JvmName(name = "contentDeepToStringNullable")
actual inline fun <T> Array<out T>?.contentDeepToString(): String
@JvmName(name = "contentDeepToStringInline")
actual inline fun <T> Array<out T>.contentDeepToString(): String
@JvmName(name = "contentDeepToStringNullable")
actual inline fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String
actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String
actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String
actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String
actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Link copied to clipboard
expect infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
expect infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
expect infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
expect infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
expect infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
expect infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are structurally equal to one another, i.e. contain the same number of the same elements in the same order.

actual infix inline fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix inline fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix inline fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are structurally equal to one another, i.e. contain the same number of the same elements in the same order.

actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are structurally equal to one another, i.e. contain the same number of the same elements in the same order.

actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean

Returns true if the two specified arrays are structurally equal to one another, i.e. contain the same number of the same elements in the same order.

Link copied to clipboard
expect fun <T> Array<out T>.contentHashCode(): Int
expect fun <T> Array<out T>?.contentHashCode(): Int
expect fun <T> Array<out T>.contentHashCode(): Int
expect fun <T> Array<out T>?.contentHashCode(): Int
expect fun <T> Array<out T>.contentHashCode(): Int
expect fun <T> Array<out T>?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

actual inline fun <T> Array<out T>.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun <T> Array<out T>?.contentHashCode(): Int
actual inline fun <T> Array<out T>.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun <T> Array<out T>?.contentHashCode(): Int
actual inline fun <T> Array<out T>.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun <T> Array<out T>?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

actual fun <T> Array<out T>.contentHashCode(): Int
actual fun <T> Array<out T>?.contentHashCode(): Int
actual fun <T> Array<out T>.contentHashCode(): Int
actual fun <T> Array<out T>?.contentHashCode(): Int
actual fun <T> Array<out T>.contentHashCode(): Int
actual fun <T> Array<out T>?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

actual fun <T> Array<out T>.contentHashCode(): Int
actual fun <T> Array<out T>?.contentHashCode(): Int
actual fun <T> Array<out T>.contentHashCode(): Int
actual fun <T> Array<out T>?.contentHashCode(): Int
actual fun <T> Array<out T>.contentHashCode(): Int
actual fun <T> Array<out T>?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

Link copied to clipboard
expect fun <T> Array<out T>.contentToString(): String
expect fun <T> Array<out T>?.contentToString(): String
expect fun <T> Array<out T>.contentToString(): String
expect fun <T> Array<out T>?.contentToString(): String
expect fun <T> Array<out T>.contentToString(): String
expect fun <T> Array<out T>?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

actual inline fun <T> Array<out T>.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun <T> Array<out T>?.contentToString(): String
actual inline fun <T> Array<out T>.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun <T> Array<out T>?.contentToString(): String
actual inline fun <T> Array<out T>.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun <T> Array<out T>?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

actual fun <T> Array<out T>.contentToString(): String
actual fun <T> Array<out T>?.contentToString(): String
actual fun <T> Array<out T>.contentToString(): String
actual fun <T> Array<out T>?.contentToString(): String
actual fun <T> Array<out T>.contentToString(): String
actual fun <T> Array<out T>?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

actual fun <T> Array<out T>.contentToString(): String
actual fun <T> Array<out T>?.contentToString(): String
actual fun <T> Array<out T>.contentToString(): String
actual fun <T> Array<out T>?.contentToString(): String
actual fun <T> Array<out T>.contentToString(): String
actual fun <T> Array<out T>?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

Link copied to clipboard
expect fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
expect fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
expect fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>

Copies this array or its subrange into the destination array and returns that array.

actual fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
actual fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
actual fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>

Copies this array or its subrange into the destination array and returns that array.

actual inline fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
actual inline fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
actual inline fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>

Copies this array or its subrange into the destination array and returns that array.

actual fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
actual fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>
actual fun <T> Array<out T>.copyInto(    destination: Array<T>,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = size): Array<T>

Copies this array or its subrange into the destination array and returns that array.

Link copied to clipboard
expect fun <T> Array<T>.copyOf(): Array<T>
expect fun <T> Array<T>.copyOf(): Array<T>
expect fun <T> Array<T>.copyOf(): Array<T>

Returns new array which is a copy of the original array.

expect fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
expect fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
expect fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun <T> Array<T>.copyOf(): Array<T>

Returns new array which is a copy of the original array.

actual inline fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
actual inline fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
actual inline fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun <T> Array<T>.copyOf(): Array<T>

Returns new array which is a copy of the original array.

actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

actual fun <T> Array<T>.copyOf(): Array<T>
actual fun <T> Array<T>.copyOf(): Array<T>
actual fun <T> Array<T>.copyOf(): Array<T>

Returns new array which is a copy of the original array.

actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>
actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

Link copied to clipboard
expect fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
expect fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
expect fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>

Returns a new array which is a copy of the specified range of the original array.

@JvmName(name = "copyOfRangeInline")
actual inline fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
@JvmName(name = "copyOfRangeInline")
actual inline fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
@JvmName(name = "copyOfRangeInline")
actual inline fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>

Returns a new array which is a copy of the specified range of the original array.

actual fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
actual fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
actual fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>

Returns a new array which is a copy of the specified range of the original array.

actual fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
actual fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
actual fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>

Returns a new array which is a copy of the specified range of the original array.

Link copied to clipboard
inline fun <T> Array<out T>.count(): Int
inline fun <T> Array<out T>.count(): Int
inline fun <T> Array<out T>.count(): Int

Returns the number of elements in this array.

inline fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int
inline fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int
inline fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int

Returns the number of elements matching the given predicate.

Link copied to clipboard
fun <T> Array<out T>.distinct(): List<T>
fun <T> Array<out T>.distinct(): List<T>
fun <T> Array<out T>.distinct(): List<T>

Returns a list containing only distinct elements from the given array.

Link copied to clipboard
inline fun <T, K> Array<out T>.distinctBy(selector: (T) -> K): List<T>
inline fun <T, K> Array<out T>.distinctBy(selector: (T) -> K): List<T>
inline fun <T, K> Array<out T>.distinctBy(selector: (T) -> K): List<T>

Returns a list containing only elements from the given array having distinct keys returned by the given selector function.

Link copied to clipboard
fun <T> Array<out T>.drop(n: Int): List<T>
fun <T> Array<out T>.drop(n: Int): List<T>
fun <T> Array<out T>.drop(n: Int): List<T>

Returns a list containing all elements except first n elements.

Link copied to clipboard
fun <T> Array<out T>.dropLast(n: Int): List<T>
fun <T> Array<out T>.dropLast(n: Int): List<T>
fun <T> Array<out T>.dropLast(n: Int): List<T>

Returns a list containing all elements except last n elements.

Link copied to clipboard
inline fun <T> Array<out T>.dropLastWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.dropLastWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.dropLastWhile(predicate: (T) -> Boolean): List<T>

Returns a list containing all elements except last elements that satisfy the given predicate.

Link copied to clipboard
inline fun <T> Array<out T>.dropWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.dropWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.dropWhile(predicate: (T) -> Boolean): List<T>

Returns a list containing all elements except first elements that satisfy the given predicate.

Link copied to clipboard
expect fun <T> Array<out T>.elementAt(index: Int): T
expect fun <T> Array<out T>.elementAt(index: Int): T
expect fun <T> Array<out 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 array.

actual inline fun <T> Array<out T>.elementAt(index: Int): T
actual inline fun <T> Array<out T>.elementAt(index: Int): T
actual inline fun <T> Array<out 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 array.

actual fun <T> Array<out T>.elementAt(index: Int): T
actual fun <T> Array<out T>.elementAt(index: Int): T
actual fun <T> Array<out 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 array.

actual inline fun <T> Array<out T>.elementAt(index: Int): T
actual inline fun <T> Array<out T>.elementAt(index: Int): T
actual inline fun <T> Array<out 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 array.

Link copied to clipboard
inline fun <T> Array<out T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T
inline fun <T> Array<out T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T
inline fun <T> Array<out T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T

Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.

Link copied to clipboard
inline fun <T> Array<out T>.elementAtOrNull(index: Int): T?
inline fun <T> Array<out T>.elementAtOrNull(index: Int): T?
inline fun <T> Array<out T>.elementAtOrNull(index: Int): T?

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

Link copied to clipboard
expect fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
expect fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
expect fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)

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

actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)

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

actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)

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

actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<T>.fill(    element: T,     fromIndex: Int = 0,     toIndex: Int = size)

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

Link copied to clipboard
inline fun <T> Array<out T>.filter(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.filter(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.filter(predicate: (T) -> Boolean): List<T>

Returns a list containing only elements matching the given predicate.

Link copied to clipboard
inline fun <T> Array<out T>.filterIndexed(predicate: (index: Int, T) -> Boolean): List<T>
inline fun <T> Array<out T>.filterIndexed(predicate: (index: Int, T) -> Boolean): List<T>
inline fun <T> Array<out T>.filterIndexed(predicate: (index: Int, T) -> Boolean): List<T>

Returns a list containing only elements matching the given predicate.

Link copied to clipboard
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C

Appends all elements matching the given predicate to the given destination.

Link copied to clipboard
inline fun <R> Array<*>.filterIsInstance(): List<R>
inline fun <R> Array<*>.filterIsInstance(): List<R>
inline fun <R> Array<*>.filterIsInstance(): List<R>

Returns a list containing all elements that are instances of specified type parameter R.

fun <R> Array<*>.filterIsInstance(klass: Class<R>): List<R>
fun <R> Array<*>.filterIsInstance(klass: Class<R>): List<R>
fun <R> Array<*>.filterIsInstance(klass: Class<R>): List<R>

Returns a list containing all elements that are instances of specified class.

Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> Array<*>.filterIsInstanceTo(destination: C): C
inline fun <R, C : MutableCollection<in R>> Array<*>.filterIsInstanceTo(destination: C): C
inline fun <R, C : MutableCollection<in R>> Array<*>.filterIsInstanceTo(destination: C): C

Appends all elements that are instances of specified type parameter R to the given destination.

fun <C : MutableCollection<in R>, R> Array<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C
fun <C : MutableCollection<in R>, R> Array<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C
fun <C : MutableCollection<in R>, R> Array<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C

Appends all elements that are instances of specified class to the given destination.

Link copied to clipboard
inline fun <T> Array<out T>.filterNot(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.filterNot(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.filterNot(predicate: (T) -> Boolean): List<T>

Returns a list containing all elements not matching the given predicate.

Link copied to clipboard
fun <T : Any> Array<out T?>.filterNotNull(): List<T>
fun <T : Any> Array<out T?>.filterNotNull(): List<T>
fun <T : Any> Array<out T?>.filterNotNull(): List<T>

Returns a list containing all elements that are not null.

Link copied to clipboard
fun <C : MutableCollection<in T>, T : Any> Array<out T?>.filterNotNullTo(destination: C): C
fun <C : MutableCollection<in T>, T : Any> Array<out T?>.filterNotNullTo(destination: C): C
fun <C : MutableCollection<in T>, T : Any> Array<out T?>.filterNotNullTo(destination: C): C

Appends all elements that are not null to the given destination.

Link copied to clipboard
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C

Appends all elements not matching the given predicate to the given destination.

Link copied to clipboard
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(destination: C, predicate: (T) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(destination: C, predicate: (T) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(destination: C, predicate: (T) -> Boolean): C

Appends all elements matching the given predicate to the given destination.

Link copied to clipboard
inline fun <T> Array<out T>.find(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.find(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.find(predicate: (T) -> Boolean): T?

Returns the first element matching the given predicate, or null if no such element was found.

Link copied to clipboard
inline fun <T> Array<out T>.findLast(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.findLast(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.findLast(predicate: (T) -> Boolean): T?

Returns the last element matching the given predicate, or null if no such element was found.

Link copied to clipboard
fun <T> Array<out T>.first(): T
fun <T> Array<out T>.first(): T
fun <T> Array<out T>.first(): T

Returns first element.

inline fun <T> Array<out T>.first(predicate: (T) -> Boolean): T
inline fun <T> Array<out T>.first(predicate: (T) -> Boolean): T
inline fun <T> Array<out T>.first(predicate: (T) -> Boolean): T

Returns the first element matching the given predicate.

Link copied to clipboard
inline fun <T, R : Any> Array<out T>.firstNotNullOf(transform: (T) -> R?): R
inline fun <T, R : Any> Array<out T>.firstNotNullOf(transform: (T) -> R?): R
inline fun <T, R : Any> Array<out T>.firstNotNullOf(transform: (T) -> R?): R

Returns the first non-null value produced by transform function being applied to elements of this array in iteration order, or throws NoSuchElementException if no non-null value was produced.

Link copied to clipboard
inline fun <T, R : Any> Array<out T>.firstNotNullOfOrNull(transform: (T) -> R?): R?
inline fun <T, R : Any> Array<out T>.firstNotNullOfOrNull(transform: (T) -> R?): R?
inline fun <T, R : Any> Array<out T>.firstNotNullOfOrNull(transform: (T) -> R?): R?

Returns the first non-null value produced by transform function being applied to elements of this array in iteration order, or null if no non-null value was produced.

Link copied to clipboard
fun <T> Array<out T>.firstOrNull(): T?
fun <T> Array<out T>.firstOrNull(): T?
fun <T> Array<out T>.firstOrNull(): T?

Returns the first element, or null if the array is empty.

inline fun <T> Array<out T>.firstOrNull(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.firstOrNull(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.firstOrNull(predicate: (T) -> Boolean): T?

Returns the first element matching the given predicate, or null if element was not found.

Link copied to clipboard
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapSequence")
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Sequence<R>): List<R>
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapSequence")
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Sequence<R>): List<R>
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapSequence")
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Sequence<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.

Link copied to clipboard
@JvmName(name = "flatMapIndexedIterable")
inline fun <T, R> Array<out T>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedSequence")
inline fun <T, R> Array<out T>.flatMapIndexed(transform: (index: Int, T) -> Sequence<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <T, R> Array<out T>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedSequence")
inline fun <T, R> Array<out T>.flatMapIndexed(transform: (index: Int, T) -> Sequence<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <T, R> Array<out T>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedSequence")
inline fun <T, R> Array<out T>.flatMapIndexed(transform: (index: Int, T) -> Sequence<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each element and its index in the original array.

Link copied to clipboard
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence<R>): C

Appends all elements yielded from results of transform function being invoked on each element and its index in the original array, to the given destination.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Iterable<R>): C
@JvmName(name = "flatMapSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Sequence<R>): C
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Iterable<R>): C
@JvmName(name = "flatMapSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Sequence<R>): C
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Iterable<R>): C
@JvmName(name = "flatMapSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Sequence<R>): C

Appends all elements yielded from results of transform function being invoked on each element of original array, to the given destination.

Link copied to clipboard
fun <T> Array<out Array<out T>>.flatten(): List<T>
fun <T> Array<out Array<out T>>.flatten(): List<T>
fun <T> Array<out Array<out T>>.flatten(): List<T>

Returns a single list of all elements from all arrays in the given array.

Link copied to clipboard
inline fun <T, R> Array<out T>.fold(initial: R, operation: (acc: R, T) -> R): R
inline fun <T, R> Array<out T>.fold(initial: R, operation: (acc: R, T) -> R): R
inline fun <T, R> Array<out T>.fold(initial: R, operation: (acc: R, T) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element.

Link copied to clipboard
inline fun <T, R> Array<out T>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R
inline fun <T, R> Array<out T>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R
inline fun <T, R> Array<out T>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original array.

Link copied to clipboard
inline fun <T, R> Array<out T>.foldRight(initial: R, operation: (T, acc: R) -> R): R
inline fun <T, R> Array<out T>.foldRight(initial: R, operation: (T, acc: R) -> R): R
inline fun <T, R> Array<out T>.foldRight(initial: R, operation: (T, acc: R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each element and current accumulator value.

Link copied to clipboard
inline fun <T, R> Array<out T>.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R
inline fun <T, R> Array<out T>.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R
inline fun <T, R> Array<out T>.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each element with its index in the original array and current accumulator value.

Link copied to clipboard
inline fun <T> Array<out T>.forEach(action: (T) -> Unit)
inline fun <T> Array<out T>.forEach(action: (T) -> Unit)
inline fun <T> Array<out T>.forEach(action: (T) -> Unit)

Performs the given action on each element.

Link copied to clipboard
inline fun <T> Array<out T>.forEachIndexed(action: (index: Int, T) -> Unit)
inline fun <T> Array<out T>.forEachIndexed(action: (index: Int, T) -> Unit)
inline fun <T> Array<out T>.forEachIndexed(action: (index: Int, T) -> Unit)

Performs the given action on each element, providing sequential index with the element.

Link copied to clipboard
inline fun <T> Array<out T>.getOrElse(index: Int, defaultValue: (Int) -> T): T
inline fun <T> Array<out T>.getOrElse(index: Int, defaultValue: (Int) -> T): T
inline fun <T> Array<out T>.getOrElse(index: Int, defaultValue: (Int) -> T): T

Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.

Link copied to clipboard
fun <T> Array<out T>.getOrNull(index: Int): T?
fun <T> Array<out T>.getOrNull(index: Int): T?
fun <T> Array<out T>.getOrNull(index: Int): T?

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

Link copied to clipboard
inline fun <T, K> Array<out T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>
inline fun <T, K> Array<out T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>
inline fun <T, K> Array<out T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>

Groups elements of the original array by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements.

inline fun <T, K, V> Array<out T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>>
inline fun <T, K, V> Array<out T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>>
inline fun <T, K, V> Array<out T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>>

Groups values returned by the valueTransform function applied to each element of the original array by the key returned by the given keySelector function applied to the element and returns a map where each group key is associated with a list of corresponding values.

Link copied to clipboard
inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Array<out T>.groupByTo(destination: M, keySelector: (T) -> K): M
inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Array<out T>.groupByTo(destination: M, keySelector: (T) -> K): M
inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Array<out T>.groupByTo(destination: M, keySelector: (T) -> K): M

Groups elements of the original array by the key returned by the given keySelector function applied to each element and puts to the destination map each group key associated with a list of corresponding elements.

inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Array<out T>.groupByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M
inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Array<out T>.groupByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M
inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Array<out T>.groupByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M

Groups values returned by the valueTransform function applied to each element of the original array by the key returned by the given keySelector function applied to the element and puts to the destination map each group key associated with a list of corresponding values.

Link copied to clipboard
inline fun <T, K> Array<out T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
inline fun <T, K> Array<out T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
inline fun <T, K> Array<out T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>

Creates a Grouping source from an array to be used later with one of group-and-fold operations using the specified keySelector function to extract a key from each element.

Link copied to clipboard
fun <T> Array<out T>.indexOf(element: T): Int
fun <T> Array<out T>.indexOf(element: T): Int
fun <T> Array<out T>.indexOf(element: T): Int

Returns first index of element, or -1 if the array does not contain element.

Link copied to clipboard
inline fun <T> Array<out T>.indexOfFirst(predicate: (T) -> Boolean): Int
inline fun <T> Array<out T>.indexOfFirst(predicate: (T) -> Boolean): Int
inline fun <T> Array<out T>.indexOfFirst(predicate: (T) -> Boolean): Int

Returns index of the first element matching the given predicate, or -1 if the array does not contain such element.

Link copied to clipboard
inline fun <T> Array<out T>.indexOfLast(predicate: (T) -> Boolean): Int
inline fun <T> Array<out T>.indexOfLast(predicate: (T) -> Boolean): Int
inline fun <T> Array<out T>.indexOfLast(predicate: (T) -> Boolean): Int

Returns index of the last element matching the given predicate, or -1 if the array does not contain such element.

Link copied to clipboard
val <T> Array<out T>.indices: IntRange
val <T> Array<out T>.indices: IntRange
val <T> Array<out T>.indices: IntRange

Returns the range of valid indices for the array.

Link copied to clipboard
infix fun <T> Array<out T>.intersect(other: Iterable<T>): Set<T>
infix fun <T> Array<out T>.intersect(other: Iterable<T>): Set<T>
infix fun <T> Array<out T>.intersect(other: Iterable<T>): Set<T>

Returns a set containing all elements that are contained by both this array and the specified collection.

Link copied to clipboard
fun <T : Any> Array<*>.isArrayOf(): Boolean
fun <T : Any> Array<*>.isArrayOf(): Boolean
fun <T : Any> Array<*>.isArrayOf(): Boolean
fun <T : Any> Array<*>.isArrayOf(): Boolean
fun <T : Any> Array<*>.isArrayOf(): Boolean
fun <T : Any> Array<*>.isArrayOf(): Boolean

Checks if array can contain element of type T.

Link copied to clipboard
inline fun <T> Array<out T>.isEmpty(): Boolean
inline fun <T> Array<out T>.isEmpty(): Boolean
inline fun <T> Array<out T>.isEmpty(): Boolean

Returns true if the array is empty.

Link copied to clipboard
inline fun <T> Array<out T>.isNotEmpty(): Boolean
inline fun <T> Array<out T>.isNotEmpty(): Boolean
inline fun <T> Array<out T>.isNotEmpty(): Boolean

Returns true if the array is not empty.

Link copied to clipboard
inline fun Array<*>?.isNullOrEmpty(): Boolean
inline fun Array<*>?.isNullOrEmpty(): Boolean
inline fun Array<*>?.isNullOrEmpty(): Boolean

Returns true if this nullable array is either null or empty.

Link copied to clipboard
fun <T, A : Appendable> Array<out T>.joinTo(    buffer: A,     separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): A
fun <T, A : Appendable> Array<out T>.joinTo(    buffer: A,     separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): A
fun <T, A : Appendable> Array<out T>.joinTo(    buffer: A,     separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): A

Appends the string from all the elements separated using separator and using the given prefix and postfix if supplied.

Link copied to clipboard
fun <T> Array<out T>.joinToString(    separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): String
fun <T> Array<out T>.joinToString(    separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): String
fun <T> Array<out T>.joinToString(    separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): String

Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

Link copied to clipboard
fun <T> Array<out T>.last(): T
fun <T> Array<out T>.last(): T
fun <T> Array<out T>.last(): T

Returns the last element.

inline fun <T> Array<out T>.last(predicate: (T) -> Boolean): T
inline fun <T> Array<out T>.last(predicate: (T) -> Boolean): T
inline fun <T> Array<out T>.last(predicate: (T) -> Boolean): T

Returns the last element matching the given predicate.

Link copied to clipboard
val <T> Array<out T>.lastIndex: Int
val <T> Array<out T>.lastIndex: Int
val <T> Array<out T>.lastIndex: Int

Returns the last valid index for the array.

Link copied to clipboard
fun <T> Array<out T>.lastIndexOf(element: T): Int
fun <T> Array<out T>.lastIndexOf(element: T): Int
fun <T> Array<out T>.lastIndexOf(element: T): Int

Returns last index of element, or -1 if the array does not contain element.

Link copied to clipboard
fun <T> Array<out T>.lastOrNull(): T?
fun <T> Array<out T>.lastOrNull(): T?
fun <T> Array<out T>.lastOrNull(): T?

Returns the last element, or null if the array is empty.

inline fun <T> Array<out T>.lastOrNull(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.lastOrNull(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.lastOrNull(predicate: (T) -> Boolean): T?

Returns the last element matching the given predicate, or null if no such element was found.

Link copied to clipboard
inline fun <T, R> Array<out T>.map(transform: (T) -> R): List<R>
inline fun <T, R> Array<out T>.map(transform: (T) -> R): List<R>
inline fun <T, R> Array<out T>.map(transform: (T) -> R): List<R>

Returns a list containing the results of applying the given transform function to each element in the original array.

Link copied to clipboard
inline fun <T, R> Array<out T>.mapIndexed(transform: (index: Int, T) -> R): List<R>
inline fun <T, R> Array<out T>.mapIndexed(transform: (index: Int, T) -> R): List<R>
inline fun <T, R> Array<out T>.mapIndexed(transform: (index: Int, T) -> R): List<R>

Returns a list containing the results of applying the given transform function to each element and its index in the original array.

Link copied to clipboard
inline fun <T, R : Any> Array<out T>.mapIndexedNotNull(transform: (index: Int, T) -> R?): List<R>
inline fun <T, R : Any> Array<out T>.mapIndexedNotNull(transform: (index: Int, T) -> R?): List<R>
inline fun <T, R : Any> Array<out T>.mapIndexedNotNull(transform: (index: Int, T) -> R?): List<R>

Returns a list containing only the non-null results of applying the given transform function to each element and its index in the original array.

Link copied to clipboard
inline fun <T, R : Any, C : MutableCollection<in R>> Array<out T>.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C
inline fun <T, R : Any, C : MutableCollection<in R>> Array<out T>.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C
inline fun <T, R : Any, C : MutableCollection<in R>> Array<out T>.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C

Applies the given transform function to each element and its index in the original array and appends only the non-null results to the given destination.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C

Applies the given transform function to each element and its index in the original array and appends the results to the given destination.

Link copied to clipboard
inline fun <T, R : Any> Array<out T>.mapNotNull(transform: (T) -> R?): List<R>
inline fun <T, R : Any> Array<out T>.mapNotNull(transform: (T) -> R?): List<R>
inline fun <T, R : Any> Array<out T>.mapNotNull(transform: (T) -> R?): List<R>

Returns a list containing only the non-null results of applying the given transform function to each element in the original array.

Link copied to clipboard
inline fun <T, R : Any, C : MutableCollection<in R>> Array<out T>.mapNotNullTo(destination: C, transform: (T) -> R?): C
inline fun <T, R : Any, C : MutableCollection<in R>> Array<out T>.mapNotNullTo(destination: C, transform: (T) -> R?): C
inline fun <T, R : Any, C : MutableCollection<in R>> Array<out T>.mapNotNullTo(destination: C, transform: (T) -> R?): C

Applies the given transform function to each element in the original array and appends only the non-null results to the given destination.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapTo(destination: C, transform: (T) -> R): C
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapTo(destination: C, transform: (T) -> R): C
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapTo(destination: C, transform: (T) -> R): C

Applies the given transform function to each element of the original array and appends the results to the given destination.

Link copied to clipboard
fun Array<out Double>.max(): Double?
fun Array<out Float>.max(): Float?
fun <T : Comparable<T>> Array<out T>.max(): T?
fun Array<out Double>.max(): Double?
fun Array<out Float>.max(): Float?
fun <T : Comparable<T>> Array<out T>.max(): T?
fun Array<out Double>.max(): Double?
fun Array<out Float>.max(): Float?
fun <T : Comparable<T>> Array<out T>.max(): T?
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.maxBy(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.maxBy(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.maxBy(selector: (T) -> R): T?
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.maxByOrNull(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.maxByOrNull(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.maxByOrNull(selector: (T) -> R): T?

Returns the first element yielding the largest value of the given function or null if there are no elements.

Link copied to clipboard
inline fun <T> Array<out T>.maxOf(selector: (T) -> Double): Double
inline fun <T> Array<out T>.maxOf(selector: (T) -> Float): Float
inline fun <T, R : Comparable<R>> Array<out T>.maxOf(selector: (T) -> R): R
inline fun <T> Array<out T>.maxOf(selector: (T) -> Double): Double
inline fun <T> Array<out T>.maxOf(selector: (T) -> Float): Float
inline fun <T, R : Comparable<R>> Array<out T>.maxOf(selector: (T) -> R): R
inline fun <T> Array<out T>.maxOf(selector: (T) -> Double): Double
inline fun <T> Array<out T>.maxOf(selector: (T) -> Float): Float
inline fun <T, R : Comparable<R>> Array<out T>.maxOf(selector: (T) -> R): R

Returns the largest value among all values produced by selector function applied to each element in the array.

Link copied to clipboard
inline fun <T> Array<out T>.maxOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Array<out T>.maxOfOrNull(selector: (T) -> Float): Float?
inline fun <T, R : Comparable<R>> Array<out T>.maxOfOrNull(selector: (T) -> R): R?
inline fun <T> Array<out T>.maxOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Array<out T>.maxOfOrNull(selector: (T) -> Float): Float?
inline fun <T, R : Comparable<R>> Array<out T>.maxOfOrNull(selector: (T) -> R): R?
inline fun <T> Array<out T>.maxOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Array<out T>.maxOfOrNull(selector: (T) -> Float): Float?
inline fun <T, R : Comparable<R>> Array<out T>.maxOfOrNull(selector: (T) -> R): R?

Returns the largest value among all values produced by selector function applied to each element in the array or null if there are no elements.

Link copied to clipboard
inline fun <T, R> Array<out T>.maxOfWith(comparator: Comparator<in R>, selector: (T) -> R): R
inline fun <T, R> Array<out T>.maxOfWith(comparator: Comparator<in R>, selector: (T) -> R): R
inline fun <T, R> Array<out T>.maxOfWith(comparator: Comparator<in R>, selector: (T) -> R): R

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array.

Link copied to clipboard
inline fun <T, R> Array<out T>.maxOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?
inline fun <T, R> Array<out T>.maxOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?
inline fun <T, R> Array<out T>.maxOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array or null if there are no elements.

Link copied to clipboard
fun Array<out Float>.maxOrNull(): Float?
fun <T : Comparable<T>> Array<out T>.maxOrNull(): T?
fun Array<out Float>.maxOrNull(): Float?
fun <T : Comparable<T>> Array<out T>.maxOrNull(): T?
fun Array<out Float>.maxOrNull(): Float?
fun <T : Comparable<T>> Array<out T>.maxOrNull(): T?

Returns the largest element or null if there are no elements.

Link copied to clipboard
fun <T> Array<out T>.maxWith(comparator: Comparator<in T>): T?
fun <T> Array<out T>.maxWith(comparator: Comparator<in T>): T?
fun <T> Array<out T>.maxWith(comparator: Comparator<in T>): T?
Link copied to clipboard
fun <T> Array<out T>.maxWithOrNull(comparator: Comparator<in T>): T?
fun <T> Array<out T>.maxWithOrNull(comparator: Comparator<in T>): T?
fun <T> Array<out T>.maxWithOrNull(comparator: Comparator<in T>): T?

Returns the first element having the largest value according to the provided comparator or null if there are no elements.

Link copied to clipboard
fun Array<out Double>.min(): Double?
fun Array<out Float>.min(): Float?
fun <T : Comparable<T>> Array<out T>.min(): T?
fun Array<out Double>.min(): Double?
fun Array<out Float>.min(): Float?
fun <T : Comparable<T>> Array<out T>.min(): T?
fun Array<out Double>.min(): Double?
fun Array<out Float>.min(): Float?
fun <T : Comparable<T>> Array<out T>.min(): T?
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.minBy(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.minBy(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.minBy(selector: (T) -> R): T?
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.minByOrNull(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.minByOrNull(selector: (T) -> R): T?
inline fun <T, R : Comparable<R>> Array<out T>.minByOrNull(selector: (T) -> R): T?

Returns the first element yielding the smallest value of the given function or null if there are no elements.

Link copied to clipboard
inline fun <T> Array<out T>.minOf(selector: (T) -> Double): Double
inline fun <T> Array<out T>.minOf(selector: (T) -> Float): Float
inline fun <T, R : Comparable<R>> Array<out T>.minOf(selector: (T) -> R): R
inline fun <T> Array<out T>.minOf(selector: (T) -> Double): Double
inline fun <T> Array<out T>.minOf(selector: (T) -> Float): Float
inline fun <T, R : Comparable<R>> Array<out T>.minOf(selector: (T) -> R): R
inline fun <T> Array<out T>.minOf(selector: (T) -> Double): Double
inline fun <T> Array<out T>.minOf(selector: (T) -> Float): Float
inline fun <T, R : Comparable<R>> Array<out T>.minOf(selector: (T) -> R): R

Returns the smallest value among all values produced by selector function applied to each element in the array.

Link copied to clipboard
inline fun <T> Array<out T>.minOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Array<out T>.minOfOrNull(selector: (T) -> Float): Float?
inline fun <T, R : Comparable<R>> Array<out T>.minOfOrNull(selector: (T) -> R): R?
inline fun <T> Array<out T>.minOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Array<out T>.minOfOrNull(selector: (T) -> Float): Float?
inline fun <T, R : Comparable<R>> Array<out T>.minOfOrNull(selector: (T) -> R): R?
inline fun <T> Array<out T>.minOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Array<out T>.minOfOrNull(selector: (T) -> Float): Float?
inline fun <T, R : Comparable<R>> Array<out T>.minOfOrNull(selector: (T) -> R): R?

Returns the smallest value among all values produced by selector function applied to each element in the array or null if there are no elements.

Link copied to clipboard
inline fun <T, R> Array<out T>.minOfWith(comparator: Comparator<in R>, selector: (T) -> R): R
inline fun <T, R> Array<out T>.minOfWith(comparator: Comparator<in R>, selector: (T) -> R): R
inline fun <T, R> Array<out T>.minOfWith(comparator: Comparator<in R>, selector: (T) -> R): R

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each element in the array.

Link copied to clipboard
inline fun <T, R> Array<out T>.minOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?
inline fun <T, R> Array<out T>.minOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?
inline fun <T, R> Array<out T>.minOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each element in the array or null if there are no elements.

Link copied to clipboard
fun Array<out Float>.minOrNull(): Float?
fun <T : Comparable<T>> Array<out T>.minOrNull(): T?
fun Array<out Float>.minOrNull(): Float?
fun <T : Comparable<T>> Array<out T>.minOrNull(): T?
fun Array<out Float>.minOrNull(): Float?
fun <T : Comparable<T>> Array<out T>.minOrNull(): T?

Returns the smallest element or null if there are no elements.

Link copied to clipboard
fun <T> Array<out T>.minWith(comparator: Comparator<in T>): T?
fun <T> Array<out T>.minWith(comparator: Comparator<in T>): T?
fun <T> Array<out T>.minWith(comparator: Comparator<in T>): T?
Link copied to clipboard
fun <T> Array<out T>.minWithOrNull(comparator: Comparator<in T>): T?
fun <T> Array<out T>.minWithOrNull(comparator: Comparator<in T>): T?
fun <T> Array<out T>.minWithOrNull(comparator: Comparator<in T>): T?

Returns the first element having the smallest value according to the provided comparator or null if there are no elements.

Link copied to clipboard
fun <T> Array<out T>.none(): Boolean
fun <T> Array<out T>.none(): Boolean
fun <T> Array<out T>.none(): Boolean

Returns true if the array has no elements.

inline fun <T> Array<out T>.none(predicate: (T) -> Boolean): Boolean
inline fun <T> Array<out T>.none(predicate: (T) -> Boolean): Boolean
inline fun <T> Array<out T>.none(predicate: (T) -> Boolean): Boolean

Returns true if no elements match the given predicate.

Link copied to clipboard
inline fun <T> Array<out T>.onEach(action: (T) -> Unit): Array<out T>
inline fun <T> Array<out T>.onEach(action: (T) -> Unit): Array<out T>
inline fun <T> Array<out T>.onEach(action: (T) -> Unit): Array<out T>

Performs the given action on each element and returns the array itself afterwards.

Link copied to clipboard
inline fun <T> Array<out T>.onEachIndexed(action: (index: Int, T) -> Unit): Array<out T>
inline fun <T> Array<out T>.onEachIndexed(action: (index: Int, T) -> Unit): Array<out T>
inline fun <T> Array<out T>.onEachIndexed(action: (index: Int, T) -> Unit): Array<out T>

Performs the given action on each element, providing sequential index with the element, and returns the array itself afterwards.

Link copied to clipboard
expect inline fun <T> Array<out T>?.orEmpty(): Array<out T>
expect inline fun <T> Array<out T>?.orEmpty(): Array<out T>
expect inline fun <T> Array<out T>?.orEmpty(): Array<out T>

Returns the array if it's not null, or an empty array otherwise.

actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>
actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>
actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>

Returns the array if it's not null, or an empty array otherwise.

actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>
actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>
actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>

Returns the array if it's not null, or an empty array otherwise.

actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>
actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>
actual inline fun <T> Array<out T>?.orEmpty(): Array<out T>

Returns the array if it's not null, or an empty array otherwise.

Link copied to clipboard
inline fun <T> Array<out T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>
inline fun <T> Array<out T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>
inline fun <T> Array<out T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>

Splits the original array into pair of lists, where first list contains elements for which predicate yielded true, while second list contains elements for which predicate yielded false.

Link copied to clipboard
expect operator fun <T> Array<T>.plus(element: T): Array<T>
expect operator fun <T> Array<T>.plus(element: T): Array<T>
expect operator fun <T> Array<T>.plus(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

expect operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
expect operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
expect operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements collection.

expect operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
expect operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
expect operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements array.

actual operator fun <T> Array<T>.plus(element: T): Array<T>
actual operator fun <T> Array<T>.plus(element: T): Array<T>
actual operator fun <T> Array<T>.plus(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements collection.

actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements array.

actual inline operator fun <T> Array<T>.plus(element: T): Array<T>
actual inline operator fun <T> Array<T>.plus(element: T): Array<T>
actual inline operator fun <T> Array<T>.plus(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements collection.

actual inline operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual inline operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual inline operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements array.

actual operator fun <T> Array<T>.plus(element: T): Array<T>
actual operator fun <T> Array<T>.plus(element: T): Array<T>
actual operator fun <T> Array<T>.plus(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements collection.

actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>

Returns an array containing all elements of the original array and then all elements of the given elements array.

Link copied to clipboard
expect fun <T> Array<T>.plusElement(element: T): Array<T>
expect fun <T> Array<T>.plusElement(element: T): Array<T>
expect fun <T> Array<T>.plusElement(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

actual inline fun <T> Array<T>.plusElement(element: T): Array<T>
actual inline fun <T> Array<T>.plusElement(element: T): Array<T>
actual inline fun <T> Array<T>.plusElement(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

actual inline fun <T> Array<T>.plusElement(element: T): Array<T>
actual inline fun <T> Array<T>.plusElement(element: T): Array<T>
actual inline fun <T> Array<T>.plusElement(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

actual inline fun <T> Array<T>.plusElement(element: T): Array<T>
actual inline fun <T> Array<T>.plusElement(element: T): Array<T>
actual inline fun <T> Array<T>.plusElement(element: T): Array<T>

Returns an array containing all elements of the original array and then the given element.

Link copied to clipboard
inline fun <T> Array<out T>.random(): T
inline fun <T> Array<out T>.random(): T
inline fun <T> Array<out T>.random(): T

Returns a random element from this array.

fun <T> Array<out T>.random(random: Random): T
fun <T> Array<out T>.random(random: Random): T
fun <T> Array<out T>.random(random: Random): T

Returns a random element from this array using the specified source of randomness.

Link copied to clipboard
inline fun <T> Array<out T>.randomOrNull(): T?
inline fun <T> Array<out T>.randomOrNull(): T?
inline fun <T> Array<out T>.randomOrNull(): T?

Returns a random element from this array, or null if this array is empty.

fun <T> Array<out T>.randomOrNull(random: Random): T?
fun <T> Array<out T>.randomOrNull(random: Random): T?
fun <T> Array<out T>.randomOrNull(random: Random): T?

Returns a random element from this array using the specified source of randomness, or null if this array is empty.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduce(operation: (acc: S, T) -> S): S
inline fun <S, T : S> Array<out T>.reduce(operation: (acc: S, T) -> S): S
inline fun <S, T : S> Array<out T>.reduce(operation: (acc: S, T) -> S): S

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S
inline fun <S, T : S> Array<out T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S
inline fun <S, T : S> Array<out T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original array.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S?
inline fun <S, T : S> Array<out T>.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S?
inline fun <S, T : S> Array<out T>.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original array.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceOrNull(operation: (acc: S, T) -> S): S?
inline fun <S, T : S> Array<out T>.reduceOrNull(operation: (acc: S, T) -> S): S?
inline fun <S, T : S> Array<out T>.reduceOrNull(operation: (acc: S, T) -> S): S?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRight(operation: (T, acc: S) -> S): S
inline fun <S, T : S> Array<out T>.reduceRight(operation: (T, acc: S) -> S): S
inline fun <S, T : S> Array<out T>.reduceRight(operation: (T, acc: S) -> S): S

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S
inline fun <S, T : S> Array<out T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S
inline fun <S, T : S> Array<out T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S): S?
inline fun <S, T : S> Array<out T>.reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S): S?
inline fun <S, T : S> Array<out T>.reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S): S?

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRightOrNull(operation: (T, acc: S) -> S): S?
inline fun <S, T : S> Array<out T>.reduceRightOrNull(operation: (T, acc: S) -> S): S?
inline fun <S, T : S> Array<out T>.reduceRightOrNull(operation: (T, acc: S) -> S): S?

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

Link copied to clipboard
fun <T : Any> Array<T?>.requireNoNulls(): Array<T>
fun <T : Any> Array<T?>.requireNoNulls(): Array<T>
fun <T : Any> Array<T?>.requireNoNulls(): Array<T>

Returns an original collection containing all the non-null elements, throwing an IllegalArgumentException if there are any null elements.

Link copied to clipboard
fun <T> Array<T>.reverse()
fun <T> Array<T>.reverse()
fun <T> Array<T>.reverse()

Reverses elements in the array in-place.

fun <T> Array<T>.reverse(fromIndex: Int, toIndex: Int)
fun <T> Array<T>.reverse(fromIndex: Int, toIndex: Int)
fun <T> Array<T>.reverse(fromIndex: Int, toIndex: Int)

Reverses elements of the array in the specified range in-place.

Link copied to clipboard
fun <T> Array<out T>.reversed(): List<T>
fun <T> Array<out T>.reversed(): List<T>
fun <T> Array<out T>.reversed(): List<T>

Returns a list with elements in reversed order.

Link copied to clipboard

Returns an array with elements of this array in reversed order.

Link copied to clipboard
inline fun <T, R> Array<out T>.runningFold(initial: R, operation: (acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.runningFold(initial: R, operation: (acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.runningFold(initial: R, operation: (acc: R, T) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun <T, R> Array<out T>.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.runningReduce(operation: (acc: S, T) -> S): List<S>
inline fun <S, T : S> Array<out T>.runningReduce(operation: (acc: S, T) -> S): List<S>
inline fun <S, T : S> Array<out T>.runningReduce(operation: (acc: S, T) -> S): List<S>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with the first element of this array.

Link copied to clipboard
inline fun <S, T : S> Array<out T>.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): List<S>
inline fun <S, T : S> Array<out T>.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): List<S>
inline fun <S, T : S> Array<out T>.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): List<S>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with the first element of this array.

Link copied to clipboard
inline fun <T, R> Array<out T>.scan(initial: R, operation: (acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.scan(initial: R, operation: (acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.scan(initial: R, operation: (acc: R, T) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun <T, R> Array<out T>.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List<R>
inline fun <T, R> Array<out T>.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with initial value.

Link copied to clipboard
fun <T> Array<T>.shuffle()
fun <T> Array<T>.shuffle()
fun <T> Array<T>.shuffle()

Randomly shuffles elements in this array in-place.

fun <T> Array<T>.shuffle(random: Random)
fun <T> Array<T>.shuffle(random: Random)
fun <T> Array<T>.shuffle(random: Random)

Randomly shuffles elements in this array in-place using the specified random instance as the source of randomness.

Link copied to clipboard
fun <T> Array<out T>.single(): T
fun <T> Array<out T>.single(): T
fun <T> Array<out T>.single(): T

Returns the single element, or throws an exception if the array is empty or has more than one element.

inline fun <T> Array<out T>.single(predicate: (T) -> Boolean): T
inline fun <T> Array<out T>.single(predicate: (T) -> Boolean): T
inline fun <T> Array<out T>.single(predicate: (T) -> Boolean): T

Returns the single element matching the given predicate, or throws exception if there is no or more than one matching element.

Link copied to clipboard
fun <T> Array<out T>.singleOrNull(): T?
fun <T> Array<out T>.singleOrNull(): T?
fun <T> Array<out T>.singleOrNull(): T?

Returns single element, or null if the array is empty or has more than one element.

inline fun <T> Array<out T>.singleOrNull(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.singleOrNull(predicate: (T) -> Boolean): T?
inline fun <T> Array<out T>.singleOrNull(predicate: (T) -> Boolean): T?

Returns the single element matching the given predicate, or null if element was not found or more than one element was found.

Link copied to clipboard
fun <T> Array<out T>.slice(indices: IntRange): List<T>
fun <T> Array<out T>.slice(indices: IntRange): List<T>
fun <T> Array<out T>.slice(indices: IntRange): List<T>

Returns a list containing elements at indices in the specified indices range.

fun <T> Array<out T>.slice(indices: Iterable<Int>): List<T>
fun <T> Array<out T>.slice(indices: Iterable<Int>): List<T>
fun <T> Array<out T>.slice(indices: Iterable<Int>): List<T>

Returns a list containing elements at specified indices.

Link copied to clipboard
fun <T> Array<T>.sliceArray(indices: Collection<Int>): Array<T>
fun <T> Array<T>.sliceArray(indices: Collection<Int>): Array<T>
fun <T> Array<T>.sliceArray(indices: Collection<Int>): Array<T>

Returns an array containing elements of this array at specified indices.

fun <T> Array<T>.sliceArray(indices: IntRange): Array<T>
fun <T> Array<T>.sliceArray(indices: IntRange): Array<T>
fun <T> Array<T>.sliceArray(indices: IntRange): Array<T>

Returns an array containing elements at indices in the specified indices range.

Link copied to clipboard
expect fun <T : Comparable<T>> Array<out T>.sort()
expect fun <T : Comparable<T>> Array<out T>.sort()
expect fun <T : Comparable<T>> Array<out T>.sort()

Sorts the array in-place according to the natural order of its elements.

expect fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
expect fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
expect fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

fun <T> Array<out T>.sort()
actual inline fun <T : Comparable<T>> Array<out T>.sort()
fun <T> Array<out T>.sort()
actual inline fun <T : Comparable<T>> Array<out T>.sort()
fun <T> Array<out T>.sort()
actual inline fun <T : Comparable<T>> Array<out T>.sort()

Sorts the array in-place according to the natural order of its elements.

fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

fun <T> Array<out T>.sort(comparison: (a: T, b: T) -> Int)
fun <T> Array<out T>.sort(comparison: (a: T, b: T) -> Int)
fun <T> Array<out T>.sort(comparison: (a: T, b: T) -> Int)

Sorts the array in-place according to the order specified by the given comparison function.

actual fun <T : Comparable<T>> Array<out T>.sort()
actual fun <T : Comparable<T>> Array<out T>.sort()
actual fun <T : Comparable<T>> Array<out T>.sort()

Sorts the array in-place according to the natural order of its elements.

actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

actual fun <T : Comparable<T>> Array<out T>.sort()
actual fun <T : Comparable<T>> Array<out T>.sort()
actual fun <T : Comparable<T>> Array<out T>.sort()

Sorts the array in-place according to the natural order of its elements.

actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.sortBy(crossinline selector: (T) -> R?)
inline fun <T, R : Comparable<R>> Array<out T>.sortBy(crossinline selector: (T) -> R?)
inline fun <T, R : Comparable<R>> Array<out T>.sortBy(crossinline selector: (T) -> R?)

Sorts elements in the array in-place according to natural sort order of the value returned by specified selector function.

Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.sortByDescending(crossinline selector: (T) -> R?)
inline fun <T, R : Comparable<R>> Array<out T>.sortByDescending(crossinline selector: (T) -> R?)
inline fun <T, R : Comparable<R>> Array<out T>.sortByDescending(crossinline selector: (T) -> R?)

Sorts elements in the array in-place descending according to natural sort order of the value returned by specified selector function.

Link copied to clipboard

Sorts elements in the array in-place descending according to their natural sort order.

fun <T : Comparable<T>> Array<out T>.sortDescending(fromIndex: Int, toIndex: Int)
fun <T : Comparable<T>> Array<out T>.sortDescending(fromIndex: Int, toIndex: Int)
fun <T : Comparable<T>> Array<out T>.sortDescending(fromIndex: Int, toIndex: Int)

Sorts elements of the array in the specified range in-place. The elements are sorted descending according to their natural sort order.

Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.sorted(): List<T>
fun <T : Comparable<T>> Array<out T>.sorted(): List<T>
fun <T : Comparable<T>> Array<out T>.sorted(): List<T>

Returns a list of all elements sorted according to their natural sort order.

Link copied to clipboard

Returns an array with all elements of this array sorted according to their natural sort order.

Link copied to clipboard

Returns an array with all elements of this array sorted descending according to their natural sort order.

Link copied to clipboard
fun <T> Array<out T>.sortedArrayWith(comparator: Comparator<in T>): Array<out T>
fun <T> Array<out T>.sortedArrayWith(comparator: Comparator<in T>): Array<out T>
fun <T> Array<out T>.sortedArrayWith(comparator: Comparator<in T>): Array<out T>

Returns an array with all elements of this array sorted according the specified comparator.

Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selector: (T) -> R?): List<T>
inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selector: (T) -> R?): List<T>
inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selector: (T) -> R?): List<T>

Returns a list of all elements sorted according to natural sort order of the value returned by specified selector function.

Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(crossinline selector: (T) -> R?): List<T>
inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(crossinline selector: (T) -> R?): List<T>
inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(crossinline selector: (T) -> R?): List<T>

Returns a list of all elements sorted descending according to natural sort order of the value returned by specified selector function.

Link copied to clipboard

Returns a list of all elements sorted descending according to their natural sort order.

Link copied to clipboard
fun <T> Array<out T>.sortedWith(comparator: Comparator<in T>): List<T>
fun <T> Array<out T>.sortedWith(comparator: Comparator<in T>): List<T>
fun <T> Array<out T>.sortedWith(comparator: Comparator<in T>): List<T>

Returns a list of all elements sorted according to the specified comparator.

Link copied to clipboard
expect fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)
expect fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)
expect fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)

Sorts the array in-place according to the order specified by the given comparator.

expect fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)
expect fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)
expect fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)

Sorts a range in the array in-place with the given comparator.

actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)
actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)
actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)

Sorts the array in-place according to the order specified by the given comparator.

actual fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)

Sorts a range in the array in-place with the given comparator.

actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)
actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)
actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)

Sorts the array in-place according to the order specified by the given comparator.

actual fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)
actual fun <T> Array<out T>.sortWith(    comparator: Comparator<in T>,     fromIndex: Int = 0,     toIndex: Int = size)

Sorts a range in the array in-place with the given comparator.

Link copied to clipboard
inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String
inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String
inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String

Returns a string representation of the contents of the subarray of the specified array as if it is List.

Link copied to clipboard
infix fun <T> Array<out T>.subtract(other: Iterable<T>): Set<T>
infix fun <T> Array<out T>.subtract(other: Iterable<T>): Set<T>
infix fun <T> Array<out T>.subtract(other: Iterable<T>): Set<T>

Returns a set containing all elements that are contained by this array and not contained by the specified collection.

Link copied to clipboard
@JvmName(name = "sumOfByte")
fun Array<out Byte>.sum(): Int
@JvmName(name = "sumOfShort")
fun Array<out Short>.sum(): Int
@JvmName(name = "sumOfInt")
fun Array<out Int>.sum(): Int
@JvmName(name = "sumOfLong")
fun Array<out Long>.sum(): Long
@JvmName(name = "sumOfFloat")
fun Array<out Float>.sum(): Float
@JvmName(name = "sumOfDouble")
fun Array<out Double>.sum(): Double
@JvmName(name = "sumOfUInt")
fun Array<out UInt>.sum(): UInt
@JvmName(name = "sumOfULong")
fun Array<out ULong>.sum(): ULong
@JvmName(name = "sumOfUByte")
fun Array<out UByte>.sum(): UInt
@JvmName(name = "sumOfUShort")
fun Array<out UShort>.sum(): UInt
@JvmName(name = "sumOfByte")
fun Array<out Byte>.sum(): Int
@JvmName(name = "sumOfShort")
fun Array<out Short>.sum(): Int
@JvmName(name = "sumOfInt")
fun Array<out Int>.sum(): Int
@JvmName(name = "sumOfLong")
fun Array<out Long>.sum(): Long
@JvmName(name = "sumOfFloat")
fun Array<out Float>.sum(): Float
@JvmName(name = "sumOfDouble")
fun Array<out Double>.sum(): Double
@JvmName(name = "sumOfUInt")
fun Array<out UInt>.sum(): UInt
@JvmName(name = "sumOfULong")
fun Array<out ULong>.sum(): ULong
@JvmName(name = "sumOfUByte")
fun Array<out UByte>.sum(): UInt
@JvmName(name = "sumOfUShort")
fun Array<out UShort>.sum(): UInt
@JvmName(name = "sumOfByte")
fun Array<out Byte>.sum(): Int
@JvmName(name = "sumOfShort")
fun Array<out Short>.sum(): Int
@JvmName(name = "sumOfInt")
fun Array<out Int>.sum(): Int
@JvmName(name = "sumOfLong")
fun Array<out Long>.sum(): Long
@JvmName(name = "sumOfFloat")
fun Array<out Float>.sum(): Float
@JvmName(name = "sumOfDouble")
fun Array<out Double>.sum(): Double
@JvmName(name = "sumOfUInt")
fun Array<out UInt>.sum(): UInt
@JvmName(name = "sumOfULong")
fun Array<out ULong>.sum(): ULong
@JvmName(name = "sumOfUByte")
fun Array<out UByte>.sum(): UInt
@JvmName(name = "sumOfUShort")
fun Array<out UShort>.sum(): UInt

Returns the sum of all elements in the array.

Link copied to clipboard
inline fun <T> Array<out T>.sumBy(selector: (T) -> Int): Int
inline fun <T> Array<out T>.sumBy(selector: (T) -> Int): Int
inline fun <T> Array<out T>.sumBy(selector: (T) -> Int): Int

Returns the sum of all values produced by selector function applied to each element in the array.

Link copied to clipboard
inline fun <T> Array<out T>.sumByDouble(selector: (T) -> Double): Double
inline fun <T> Array<out T>.sumByDouble(selector: (T) -> Double): Double
inline fun <T> Array<out T>.sumByDouble(selector: (T) -> Double): Double

Returns the sum of all values produced by selector function applied to each element in the array.

Link copied to clipboard
@JvmName(name = "sumOfDouble")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun <T> Array<out T>.sumOf(selector: (T) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun <T> Array<out T>.sumOf(selector: (T) -> ULong): ULong
@JvmName(name = "sumOfDouble")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun <T> Array<out T>.sumOf(selector: (T) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun <T> Array<out T>.sumOf(selector: (T) -> ULong): ULong
@JvmName(name = "sumOfDouble")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun <T> Array<out T>.sumOf(selector: (T) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun <T> Array<out T>.sumOf(selector: (T) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun <T> Array<out T>.sumOf(selector: (T) -> ULong): ULong

Returns the sum of all values produced by selector function applied to each element in the array.

@JvmName(name = "sumOfBigDecimal")
inline fun <T> Array<out T>.sumOf(selector: (T) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun <T> Array<out T>.sumOf(selector: (T) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun <T> Array<out T>.sumOf(selector: (T) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun <T> Array<out T>.sumOf(selector: (T) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun <T> Array<out T>.sumOf(selector: (T) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun <T> Array<out T>.sumOf(selector: (T) -> BigInteger): BigInteger

Returns the sum of all values produced by selector function applied to each element in the array.

Link copied to clipboard
fun <T> Array<out T>.take(n: Int): List<T>
fun <T> Array<out T>.take(n: Int): List<T>
fun <T> Array<out T>.take(n: Int): List<T>

Returns a list containing first n elements.

Link copied to clipboard
fun <T> Array<out T>.takeLast(n: Int): List<T>
fun <T> Array<out T>.takeLast(n: Int): List<T>
fun <T> Array<out T>.takeLast(n: Int): List<T>

Returns a list containing last n elements.

Link copied to clipboard
inline fun <T> Array<out T>.takeLastWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.takeLastWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.takeLastWhile(predicate: (T) -> Boolean): List<T>

Returns a list containing last elements satisfying the given predicate.

Link copied to clipboard
inline fun <T> Array<out T>.takeWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.takeWhile(predicate: (T) -> Boolean): List<T>
inline fun <T> Array<out T>.takeWhile(predicate: (T) -> Boolean): List<T>

Returns a list containing first elements satisfying the given predicate.

Link copied to clipboard

Returns an array of Boolean containing all of the elements of this generic array.

Link copied to clipboard

Returns an array of Byte containing all of the elements of this generic array.

Link copied to clipboard

Returns an array of Char containing all of the elements of this generic array.

Link copied to clipboard
fun <T, C : MutableCollection<in T>> Array<out T>.toCollection(destination: C): C
fun <T, C : MutableCollection<in T>> Array<out T>.toCollection(destination: C): C
fun <T, C : MutableCollection<in T>> Array<out T>.toCollection(destination: C): C

Appends all elements to the given destination collection.

Link copied to clipboard

Convert this array of Kotlin strings to C array of C strings, allocating memory for the array and C strings with given AutofreeScope.

Link copied to clipboard

Returns an array of Double containing all of the elements of this generic array.

Link copied to clipboard

Returns an array of Float containing all of the elements of this generic array.

Link copied to clipboard
fun <T> Array<out T>.toHashSet(): HashSet<T>
fun <T> Array<out T>.toHashSet(): HashSet<T>
fun <T> Array<out T>.toHashSet(): HashSet<T>

Returns a new HashSet of all elements.

Link copied to clipboard

Returns an array of Int containing all of the elements of this generic array.

Link copied to clipboard
fun <T> Array<out T>.toList(): List<T>
fun <T> Array<out T>.toList(): List<T>
fun <T> Array<out T>.toList(): List<T>

Returns a List containing all elements.

Link copied to clipboard

Returns an array of Long containing all of the elements of this generic array.

Link copied to clipboard
fun <K, V> Array<out Pair<K, V>>.toMap(): Map<K, V>
fun <K, V> Array<out Pair<K, V>>.toMap(): Map<K, V>
fun <K, V> Array<out Pair<K, V>>.toMap(): Map<K, V>

Returns a new map containing all key-value pairs from the given array of pairs.

fun <K, V, M : MutableMap<in K, in V>> Array<out Pair<K, V>>.toMap(destination: M): M
fun <K, V, M : MutableMap<in K, in V>> Array<out Pair<K, V>>.toMap(destination: M): M
fun <K, V, M : MutableMap<in K, in V>> Array<out Pair<K, V>>.toMap(destination: M): M

Populates and returns the destination mutable map with key-value pairs from the given array of pairs.

Link copied to clipboard

Returns a new MutableList filled with all elements of this array.

Link copied to clipboard
fun <T> Array<out T>.toMutableSet(): MutableSet<T>
fun <T> Array<out T>.toMutableSet(): MutableSet<T>
fun <T> Array<out T>.toMutableSet(): MutableSet<T>

Returns a new MutableSet containing all distinct elements from the given array.

Link copied to clipboard
fun <T> Array<out T>.toSet(): Set<T>
fun <T> Array<out T>.toSet(): Set<T>
fun <T> Array<out T>.toSet(): Set<T>

Returns a Set of all elements.

Link copied to clipboard

Returns an array of Short containing all of the elements of this generic array.

Link copied to clipboard
fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>
fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>
fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>

Returns a new SortedSet of all elements.

Link copied to clipboard

Returns an array of UByte containing all of the elements of this generic array.

Link copied to clipboard

Returns an array of UInt containing all of the elements of this generic array.

Link copied to clipboard

Returns an array of ULong containing all of the elements of this generic array.

Link copied to clipboard

Returns an array of UShort containing all of the elements of this generic array.

Link copied to clipboard
infix fun <T> Array<out T>.union(other: Iterable<T>): Set<T>
infix fun <T> Array<out T>.union(other: Iterable<T>): Set<T>
infix fun <T> Array<out T>.union(other: Iterable<T>): Set<T>

Returns a set containing all distinct elements from both collections.

Link copied to clipboard
fun <T, R> Array<out Pair<T, R>>.unzip(): Pair<List<T>, List<R>>
fun <T, R> Array<out Pair<T, R>>.unzip(): Pair<List<T>, List<R>>
fun <T, R> Array<out Pair<T, R>>.unzip(): Pair<List<T>, List<R>>

Returns a pair of lists, where first list is built from the first values of each pair from this array, second list is built from the second values of each pair from this array.

Link copied to clipboard

Returns a lazy Iterable that wraps each element of the original array into an IndexedValue containing the index of that element and the element itself.

Link copied to clipboard
infix fun <T, R> Array<out T>.zip(other: Array<out R>): List<Pair<T, R>>
infix fun <T, R> Array<out T>.zip(other: Array<out R>): List<Pair<T, R>>
infix fun <T, R> Array<out T>.zip(other: Array<out R>): List<Pair<T, R>>

Returns a list of pairs built from the elements of this array and the other array with the same index. The returned list has length of the shortest collection.

inline fun <T, R, V> Array<out T>.zip(other: Array<out R>, transform: (a: T, b: R) -> V): List<V>
inline fun <T, R, V> Array<out T>.zip(other: Array<out R>, transform: (a: T, b: R) -> V): List<V>
inline fun <T, R, V> Array<out T>.zip(other: Array<out R>, transform: (a: T, b: R) -> V): List<V>

Returns a list of values built from the elements of this array and the other array with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest collection.

infix fun <T, R> Array<out T>.zip(other: Iterable<R>): List<Pair<T, R>>
infix fun <T, R> Array<out T>.zip(other: Iterable<R>): List<Pair<T, R>>
infix fun <T, R> Array<out T>.zip(other: Iterable<R>): List<Pair<T, R>>

Returns a list of pairs built from the elements of this collection and other array with the same index. The returned list has length of the shortest collection.

inline fun <T, R, V> Array<out T>.zip(other: Iterable<R>, transform: (a: T, b: R) -> V): List<V>
inline fun <T, R, V> Array<out T>.zip(other: Iterable<R>, transform: (a: T, b: R) -> V): List<V>
inline fun <T, R, V> Array<out T>.zip(other: Iterable<R>, transform: (a: T, b: R) -> V): List<V>

Returns a list of values built from the elements of this array and the other collection with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest collection.