Package kotlin.collections

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Types

AbstractCollection
Link copied to clipboard
abstract class AbstractCollection<out E> : Collection<E>

Provides a skeletal implementation of the read-only Collection interface.

Since Kotlin

1.1
AbstractIterator
Link copied to clipboard
abstract class AbstractIterator<T> : Iterator<T>

A base class to simplify implementing iterators so that implementations only have to implement computeNext to implement the iterator, calling done when the iteration is complete.

AbstractList
Link copied to clipboard
abstract class AbstractList<out E> : AbstractCollection<E> , List<E>

Provides a skeletal implementation of the read-only List interface.

Since Kotlin

1.1
AbstractMap
Link copied to clipboard
abstract class AbstractMap<K, out V> : Map<K, V>

Provides a skeletal implementation of the read-only Map interface.

Since Kotlin

1.1
AbstractMutableCollection
Link copied to clipboard
expect abstract class AbstractMutableCollection<E> : MutableCollection<E>

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin

1.3
actual abstract class AbstractMutableCollection<E> : AbstractCollection<E> , MutableCollection<E>

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin

1.1
actual abstract class AbstractMutableCollection<E> : AbstractCollection<E> , MutableCollection<E>

Provides a skeletal implementation of the MutableCollection interface.

actual abstract class AbstractMutableCollection<E> : AbstractCollection<E> , MutableCollection<E>

Provides a skeletal implementation of the MutableCollection interface.

AbstractMutableList
Link copied to clipboard
expect abstract class AbstractMutableList<E> : MutableList<E>

Provides a skeletal implementation of the MutableList interface.

actual abstract class AbstractMutableList<E> : AbstractList<E> , MutableList<E>

Provides a skeletal implementation of the MutableList interface.

Since Kotlin

1.1
actual abstract class AbstractMutableList<E> : AbstractMutableCollection<E> , MutableList<E>

Provides a skeletal implementation of the MutableList interface.

actual abstract class AbstractMutableList<E> : AbstractMutableCollection<E> , MutableList<E>

Provides a skeletal implementation of the MutableList interface.

AbstractMutableMap
Link copied to clipboard
expect abstract class AbstractMutableMap<K, V> : MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin

1.3
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin

1.1
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin

1.1
AbstractMutableSet
Link copied to clipboard
expect abstract class AbstractMutableSet<E> : MutableSet<E>

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin

1.3
actual abstract class AbstractMutableSet<E> : AbstractSet<E> , MutableSet<E>

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin

1.1
actual abstract class AbstractMutableSet<E> : AbstractMutableCollection<E> , MutableSet<E>

Provides a skeletal implementation of the MutableSet interface.

actual abstract class AbstractMutableSet<E> : AbstractMutableCollection<E> , MutableSet<E>

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin

1.1
AbstractSet
Link copied to clipboard
abstract class AbstractSet<out E> : AbstractCollection<E> , Set<E>

Provides a skeletal implementation of the read-only Set interface.

Since Kotlin

1.1
ArrayDeque
Link copied to clipboard
class ArrayDeque<E> : AbstractMutableList<E>

Resizable-array implementation of the deque data structure.

Since Kotlin

1.4
ArrayList
Link copied to clipboard
expect class ArrayList<E> : MutableList<E> , RandomAccess
actual typealias ArrayList = ArrayList<E>
actual open class ArrayList<E> : AbstractMutableList<E> , MutableList<E> , RandomAccess

Provides a MutableList implementation, which uses a resizable array as its backing storage.

actual class ArrayList<E> : AbstractMutableList<E> , MutableList<E> , RandomAccess
BooleanIterator
Link copied to clipboard
abstract class BooleanIterator : Iterator<Boolean>

An iterator over a sequence of values of type Boolean.

abstract class BooleanIterator : Iterator<Boolean>

An iterator over a sequence of values of type Boolean.

abstract class BooleanIterator : Iterator<Boolean>

An iterator over a sequence of values of type Boolean.

abstract class BooleanIterator : Iterator<Boolean>

An iterator over a sequence of values of type Boolean.

ByteIterator
Link copied to clipboard
abstract class ByteIterator : Iterator<Byte>

An iterator over a sequence of values of type Byte.

abstract class ByteIterator : Iterator<Byte>

An iterator over a sequence of values of type Byte.

abstract class ByteIterator : Iterator<Byte>

An iterator over a sequence of values of type Byte.

abstract class ByteIterator : Iterator<Byte>

An iterator over a sequence of values of type Byte.

CharIterator
Link copied to clipboard
abstract class CharIterator : Iterator<Char>

An iterator over a sequence of values of type Char.

abstract class CharIterator : Iterator<Char>

An iterator over a sequence of values of type Char.

abstract class CharIterator : Iterator<Char>

An iterator over a sequence of values of type Char.

abstract class CharIterator : Iterator<Char>

An iterator over a sequence of values of type Char.

Collection
Link copied to clipboard
interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

DoubleIterator
Link copied to clipboard
abstract class DoubleIterator : Iterator<Double>

An iterator over a sequence of values of type Double.

abstract class DoubleIterator : Iterator<Double>

An iterator over a sequence of values of type Double.

abstract class DoubleIterator : Iterator<Double>

An iterator over a sequence of values of type Double.

abstract class DoubleIterator : Iterator<Double>

An iterator over a sequence of values of type Double.

FloatIterator
Link copied to clipboard
abstract class FloatIterator : Iterator<Float>

An iterator over a sequence of values of type Float.

abstract class FloatIterator : Iterator<Float>

An iterator over a sequence of values of type Float.

abstract class FloatIterator : Iterator<Float>

An iterator over a sequence of values of type Float.

abstract class FloatIterator : Iterator<Float>

An iterator over a sequence of values of type Float.

Grouping
Link copied to clipboard
interface Grouping<T, out K>

Represents a source of elements with a keyOf function, which can be applied to each element to get its key.

Since Kotlin

1.1
HashMap
Link copied to clipboard
expect class HashMap<K, V> : MutableMap<K, V>
actual typealias HashMap = HashMap<K, V>
actual open class HashMap<K, V> : AbstractMutableMap<K, V> , MutableMap<K, V>

Hash table based implementation of the MutableMap interface.

actual class HashMap<K, V> : MutableMap<K, V>
HashSet
Link copied to clipboard
expect class HashSet<E> : MutableSet<E>
actual typealias HashSet = HashSet<E>
actual open class HashSet<E> : AbstractMutableSet<E> , MutableSet<E>

The implementation of the MutableSet interface, backed by a HashMap instance.

actual class HashSet<E> : AbstractMutableSet<E> , MutableSet<E> , KonanSet<E>
IndexedValue
Link copied to clipboard
data class IndexedValue<out T>(index: Int, value: T)

Data class representing a value from a collection or sequence, along with its index in that collection or sequence.

IntIterator
Link copied to clipboard
abstract class IntIterator : Iterator<Int>

An iterator over a sequence of values of type Int.

abstract class IntIterator : Iterator<Int>

An iterator over a sequence of values of type Int.

abstract class IntIterator : Iterator<Int>

An iterator over a sequence of values of type Int.

abstract class IntIterator : Iterator<Int>

An iterator over a sequence of values of type Int.

Iterable
Link copied to clipboard
interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

Iterator
Link copied to clipboard
interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

LinkedHashMap
Link copied to clipboard
expect class LinkedHashMap<K, V> : MutableMap<K, V>
actual typealias LinkedHashMap = LinkedHashMap<K, V>
actual open class LinkedHashMap<K, V> : HashMap<K, V> , MutableMap<K, V>

Hash table based implementation of the MutableMap interface, which additionally preserves the insertion order of entries during the iteration.

actual typealias LinkedHashMap = HashMap<K, V>
LinkedHashSet
Link copied to clipboard
expect class LinkedHashSet<E> : MutableSet<E>
actual typealias LinkedHashSet = LinkedHashSet<E>
actual open class LinkedHashSet<E> : HashSet<E> , MutableSet<E>

The implementation of the MutableSet interface, backed by a LinkedHashMap instance.

actual typealias LinkedHashSet = HashSet<V>
List
Link copied to clipboard
interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

ListIterator
Link copied to clipboard
interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

LongIterator
Link copied to clipboard
abstract class LongIterator : Iterator<Long>

An iterator over a sequence of values of type Long.

abstract class LongIterator : Iterator<Long>

An iterator over a sequence of values of type Long.

abstract class LongIterator : Iterator<Long>

An iterator over a sequence of values of type Long.

abstract class LongIterator : Iterator<Long>

An iterator over a sequence of values of type Long.

Map
Link copied to clipboard
interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

MutableCollection
Link copied to clipboard
interface MutableCollection<E> : Collection<E> , MutableIterable<E>

A generic collection of elements that supports adding and removing elements.

interface MutableCollection<E> : Collection<E> , MutableIterable<E>

A generic collection of elements that supports adding and removing elements.

interface MutableCollection<E> : Collection<E> , MutableIterable<E>

A generic collection of elements that supports adding and removing elements.

interface MutableCollection<E> : Collection<E> , MutableIterable<E>

A generic collection of elements that supports adding and removing elements.

MutableIterable
Link copied to clipboard
interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

MutableIterator
Link copied to clipboard
interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

MutableList
Link copied to clipboard
interface MutableList<E> : List<E> , MutableCollection<E>

A generic ordered collection of elements that supports adding and removing elements.

interface MutableList<E> : List<E> , MutableCollection<E>

A generic ordered collection of elements that supports adding and removing elements.

interface MutableList<E> : List<E> , MutableCollection<E>

A generic ordered collection of elements that supports adding and removing elements.

interface MutableList<E> : List<E> , MutableCollection<E>

A generic ordered collection of elements that supports adding and removing elements.

MutableListIterator
Link copied to clipboard
interface MutableListIterator<T> : ListIterator<T> , MutableIterator<T>

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

interface MutableListIterator<T> : ListIterator<T> , MutableIterator<T>

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

interface MutableListIterator<T> : ListIterator<T> , MutableIterator<T>

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

interface MutableListIterator<T> : ListIterator<T> , MutableIterator<T>

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

MutableMap
Link copied to clipboard
interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

MutableSet
Link copied to clipboard
interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

RandomAccess
Link copied to clipboard
expect interface RandomAccess
actual typealias RandomAccess = RandomAccess
actual interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

actual interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

Set
Link copied to clipboard
interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

ShortIterator
Link copied to clipboard
abstract class ShortIterator : Iterator<Short>

An iterator over a sequence of values of type Short.

abstract class ShortIterator : Iterator<Short>

An iterator over a sequence of values of type Short.

abstract class ShortIterator : Iterator<Short>

An iterator over a sequence of values of type Short.

abstract class ShortIterator : Iterator<Short>

An iterator over a sequence of values of type Short.

UByteIterator
Link copied to clipboard
abstract class UByteIterator : Iterator<UByte>

An iterator over a sequence of values of type UByte.

Since Kotlin

1.3
UIntIterator
Link copied to clipboard
abstract class UIntIterator : Iterator<UInt>

An iterator over a sequence of values of type UInt.

Since Kotlin

1.3
ULongIterator
Link copied to clipboard
abstract class ULongIterator : Iterator<ULong>

An iterator over a sequence of values of type ULong.

Since Kotlin

1.3
UShortIterator
Link copied to clipboard
abstract class UShortIterator : Iterator<UShort>

An iterator over a sequence of values of type UShort.

Since Kotlin

1.3

Functions

addAll
Link copied to clipboard
fun <T> MutableCollection<in T>.addAll(elements: Array<out T>): Boolean

Adds all elements of the given elements array to this MutableCollection.

fun <T> MutableCollection<in T>.addAll(elements: Iterable<T>): Boolean

Adds all elements of the given elements collection to this MutableCollection.

fun <T> MutableCollection<in T>.addAll(elements: Sequence<T>): Boolean

Adds all elements of the given elements sequence to this MutableCollection.

aggregate
Link copied to clipboard
inline fun <T, K, R> Grouping<T, K>.aggregate(operation: (K, R?, T, first: Boolean) -> R): Map<K, R>

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map.

Since Kotlin

1.1
aggregateTo
Link copied to clipboard
inline fun <T, K, R, M : MutableMap<in K, R>> Grouping<T, K>.aggregateTo(destination: M, operation: (K, R?, T, first: Boolean) -> R): M

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map.

Since Kotlin

1.1
all
Link copied to clipboard
inline fun <T> Array<out T>.all(predicate: (T) -> Boolean): Boolean
inline fun BooleanArray.all(predicate: (Boolean) -> Boolean): Boolean
inline fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean
inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean
inline fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean
inline fun FloatArray.all(predicate: (Float) -> Boolean): Boolean
inline fun IntArray.all(predicate: (Int) -> Boolean): Boolean
inline fun LongArray.all(predicate: (Long) -> Boolean): Boolean
inline fun ShortArray.all(predicate: (Short) -> Boolean): Boolean
inline fun <T> Iterable<T>.all(predicate: (T) -> Boolean): Boolean

Returns true if all elements match the given predicate.

inline fun UByteArray.all(predicate: (UByte) -> Boolean): Boolean
inline fun UIntArray.all(predicate: (UInt) -> Boolean): Boolean
inline fun ULongArray.all(predicate: (ULong) -> Boolean): Boolean
inline fun UShortArray.all(predicate: (UShort) -> Boolean): Boolean

Returns true if all elements match the given predicate.

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>.all(predicate: (Map.Entry<K, V>) -> Boolean): Boolean

Returns true if all entries match the given predicate.

any
Link copied to clipboard
fun <T> Array<out T>.any(): Boolean
fun BooleanArray.any(): Boolean
fun ByteArray.any(): Boolean
fun CharArray.any(): Boolean
fun DoubleArray.any(): Boolean
fun FloatArray.any(): Boolean
fun IntArray.any(): Boolean
fun LongArray.any(): Boolean
fun ShortArray.any(): Boolean

Returns true if array has at least one element.

inline fun UByteArray.any(): Boolean
inline fun UIntArray.any(): Boolean
inline fun ULongArray.any(): Boolean
inline fun UShortArray.any(): Boolean

Returns true if array has at least one element.

Since Kotlin

1.3
fun <T> Iterable<T>.any(): Boolean

Returns true if collection has at least one element.

fun <K, V> Map<out K, V>.any(): Boolean

Returns true if map has at least one entry.

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

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

inline fun UByteArray.any(predicate: (UByte) -> Boolean): Boolean
inline fun UIntArray.any(predicate: (UInt) -> Boolean): Boolean
inline fun ULongArray.any(predicate: (ULong) -> Boolean): Boolean
inline fun UShortArray.any(predicate: (UShort) -> Boolean): Boolean

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

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>.any(predicate: (Map.Entry<K, V>) -> Boolean): Boolean

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

arrayListOf
Link copied to clipboard
inline fun <T> arrayListOf(): ArrayList<T>

Returns an empty new ArrayList.

Since Kotlin

1.1
fun <T> arrayListOf(vararg elements: T): ArrayList<T>

Returns a new ArrayList with the given elements.

asByteArray
Link copied to clipboard
inline fun UByteArray.asByteArray(): ByteArray

Returns an array of type ByteArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
asIntArray
Link copied to clipboard
inline fun UIntArray.asIntArray(): IntArray

Returns an array of type IntArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
asIterable
Link copied to clipboard
fun <T> Array<out T>.asIterable(): Iterable<T>
fun BooleanArray.asIterable(): Iterable<Boolean>
fun ByteArray.asIterable(): Iterable<Byte>
fun CharArray.asIterable(): Iterable<Char>
fun DoubleArray.asIterable(): Iterable<Double>
fun FloatArray.asIterable(): Iterable<Float>
fun IntArray.asIterable(): Iterable<Int>
fun LongArray.asIterable(): Iterable<Long>
fun ShortArray.asIterable(): Iterable<Short>

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

inline fun <T> Iterable<T>.asIterable(): Iterable<T>

Returns this collection as an Iterable.

inline fun <K, V> Map<out K, V>.asIterable(): Iterable<Map.Entry<K, V>>

Creates an Iterable instance that wraps the original map returning its entries when being iterated.

asList
Link copied to clipboard
expect fun <T> Array<out T>.asList(): List<T>
expect fun BooleanArray.asList(): List<Boolean>
expect fun ByteArray.asList(): List<Byte>
expect fun CharArray.asList(): List<Char>
expect fun DoubleArray.asList(): List<Double>
expect fun FloatArray.asList(): List<Float>
expect fun IntArray.asList(): List<Int>
expect fun LongArray.asList(): List<Long>
expect fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

expect fun UByteArray.asList(): List<UByte>
expect fun UIntArray.asList(): List<UInt>
expect fun ULongArray.asList(): List<ULong>
expect fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

Since Kotlin

1.3
actual fun <T> Array<out T>.asList(): List<T>
actual fun BooleanArray.asList(): List<Boolean>
actual fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual fun DoubleArray.asList(): List<Double>
actual fun FloatArray.asList(): List<Float>
actual fun IntArray.asList(): List<Int>
actual fun LongArray.asList(): List<Long>
actual fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UByteArray.asList(): List<UByte>
@ExperimentalUnsignedTypes
actual fun UIntArray.asList(): List<UInt>
@ExperimentalUnsignedTypes
actual fun ULongArray.asList(): List<ULong>
@ExperimentalUnsignedTypes
actual fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

Since Kotlin

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

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UByteArray.asList(): List<UByte>
@ExperimentalUnsignedTypes
actual fun UIntArray.asList(): List<UInt>
@ExperimentalUnsignedTypes
actual fun ULongArray.asList(): List<ULong>
@ExperimentalUnsignedTypes
actual fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

Since Kotlin

1.3
actual fun <T> Array<out T>.asList(): List<T>
actual fun BooleanArray.asList(): List<Boolean>
actual fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual fun DoubleArray.asList(): List<Double>
actual fun FloatArray.asList(): List<Float>
actual fun IntArray.asList(): List<Int>
actual fun LongArray.asList(): List<Long>
actual fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UByteArray.asList(): List<UByte>
@ExperimentalUnsignedTypes
actual fun UIntArray.asList(): List<UInt>
@ExperimentalUnsignedTypes
actual fun ULongArray.asList(): List<ULong>
@ExperimentalUnsignedTypes
actual fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

Since Kotlin

1.3
asLongArray
Link copied to clipboard
inline fun ULongArray.asLongArray(): LongArray

Returns an array of type LongArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
asReversed
Link copied to clipboard
fun <T> List<T>.asReversed(): List<T>

Returns a reversed read-only view of the original List. All changes made in the original list will be reflected in the reversed one.

@JvmName(name = "asReversedMutable")
fun <T> MutableList<T>.asReversed(): MutableList<T>

Returns a reversed mutable view of the original mutable List. All changes made in the original list will be reflected in the reversed one and vice versa.

asSequence
Link copied to clipboard
fun <T> Array<out T>.asSequence(): Sequence<T>
fun BooleanArray.asSequence(): Sequence<Boolean>
fun ByteArray.asSequence(): Sequence<Byte>
fun CharArray.asSequence(): Sequence<Char>
fun DoubleArray.asSequence(): Sequence<Double>
fun FloatArray.asSequence(): Sequence<Float>
fun IntArray.asSequence(): Sequence<Int>
fun LongArray.asSequence(): Sequence<Long>
fun ShortArray.asSequence(): Sequence<Short>

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

fun <T> Iterable<T>.asSequence(): Sequence<T>

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

fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>>

Creates a Sequence instance that wraps the original map returning its entries when being iterated.

asShortArray
Link copied to clipboard
inline fun UShortArray.asShortArray(): ShortArray

Returns an array of type ShortArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
associate
Link copied to clipboard
inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>
inline fun <K, V> BooleanArray.associate(transform: (Boolean) -> Pair<K, V>): Map<K, V>
inline fun <K, V> ByteArray.associate(transform: (Byte) -> Pair<K, V>): Map<K, V>
inline fun <K, V> CharArray.associate(transform: (Char) -> Pair<K, V>): Map<K, V>
inline fun <K, V> DoubleArray.associate(transform: (Double) -> Pair<K, V>): Map<K, V>
inline fun <K, V> FloatArray.associate(transform: (Float) -> Pair<K, V>): Map<K, V>
inline fun <K, V> IntArray.associate(transform: (Int) -> Pair<K, V>): Map<K, V>
inline fun <K, V> LongArray.associate(transform: (Long) -> Pair<K, V>): Map<K, V>
inline fun <K, V> ShortArray.associate(transform: (Short) -> Pair<K, V>): Map<K, V>

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

inline fun <T, K, V> Iterable<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 collection.

associateBy
Link copied to clipboard
inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K, T>
inline fun <K> BooleanArray.associateBy(keySelector: (Boolean) -> K): Map<K, Boolean>
inline fun <K> ByteArray.associateBy(keySelector: (Byte) -> K): Map<K, Byte>
inline fun <K> CharArray.associateBy(keySelector: (Char) -> K): Map<K, Char>
inline fun <K> DoubleArray.associateBy(keySelector: (Double) -> K): Map<K, Double>
inline fun <K> FloatArray.associateBy(keySelector: (Float) -> K): Map<K, Float>
inline fun <K> IntArray.associateBy(keySelector: (Int) -> K): Map<K, Int>
inline fun <K> LongArray.associateBy(keySelector: (Long) -> K): Map<K, Long>
inline fun <K> ShortArray.associateBy(keySelector: (Short) -> K): Map<K, Short>

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> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K, T>

Returns a Map containing the elements from the given collection 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 <K, V> BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map<K, V>
inline fun <K, V> ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map<K, V>
inline fun <K, V> CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>
inline fun <K, V> DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map<K, V>
inline fun <K, V> FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map<K, V>
inline fun <K, V> IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map<K, V>
inline fun <K, V> LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map<K, V>
inline fun <K, V> ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> 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.

inline fun <T, K, V> Iterable<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 collection.

associateByTo
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 <K, M : MutableMap<in K, in Boolean>> BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K): M
inline fun <K, M : MutableMap<in K, in Byte>> ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K): M
inline fun <K, M : MutableMap<in K, in Char>> CharArray.associateByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, in Double>> DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K): M
inline fun <K, M : MutableMap<in K, in Float>> FloatArray.associateByTo(destination: M, keySelector: (Float) -> K): M
inline fun <K, M : MutableMap<in K, in Int>> IntArray.associateByTo(destination: M, keySelector: (Int) -> K): M
inline fun <K, M : MutableMap<in K, in Long>> LongArray.associateByTo(destination: M, keySelector: (Long) -> K): M
inline fun <K, M : MutableMap<in K, in Short>> ShortArray.associateByTo(destination: M, keySelector: (Short) -> 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, M : MutableMap<in K, in T>> Iterable<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 collection 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 <K, V, M : MutableMap<in K, in V>> BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> CharArray.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> FloatArray.associateByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> IntArray.associateByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> LongArray.associateByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> ShortArray.associateByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> 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.

inline fun <T, K, V, M : MutableMap<in K, in V>> Iterable<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 collection.

associateTo
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 <K, V, M : MutableMap<in K, in V>> BooleanArray.associateTo(destination: M, transform: (Boolean) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> ByteArray.associateTo(destination: M, transform: (Byte) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> CharArray.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> DoubleArray.associateTo(destination: M, transform: (Double) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> FloatArray.associateTo(destination: M, transform: (Float) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> IntArray.associateTo(destination: M, transform: (Int) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> LongArray.associateTo(destination: M, transform: (Long) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> ShortArray.associateTo(destination: M, transform: (Short) -> 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.

inline fun <T, K, V, M : MutableMap<in K, in V>> Iterable<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 collection.

associateWith
Link copied to clipboard
inline fun <K, V> Array<out K>.associateWith(valueSelector: (K) -> V): Map<K, V>
inline fun <V> BooleanArray.associateWith(valueSelector: (Boolean) -> V): Map<Boolean, V>
inline fun <V> ByteArray.associateWith(valueSelector: (Byte) -> V): Map<Byte, V>
inline fun <V> CharArray.associateWith(valueSelector: (Char) -> V): Map<Char, V>
inline fun <V> DoubleArray.associateWith(valueSelector: (Double) -> V): Map<Double, V>
inline fun <V> FloatArray.associateWith(valueSelector: (Float) -> V): Map<Float, V>
inline fun <V> IntArray.associateWith(valueSelector: (Int) -> V): Map<Int, V>
inline fun <V> LongArray.associateWith(valueSelector: (Long) -> V): Map<Long, V>
inline fun <V> ShortArray.associateWith(valueSelector: (Short) -> V): Map<Short, V>
inline fun <V> UByteArray.associateWith(valueSelector: (UByte) -> V): Map<UByte, V>
inline fun <V> UIntArray.associateWith(valueSelector: (UInt) -> V): Map<UInt, V>
inline fun <V> ULongArray.associateWith(valueSelector: (ULong) -> V): Map<ULong, V>
inline fun <V> UShortArray.associateWith(valueSelector: (UShort) -> V): Map<UShort, V>

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

Since Kotlin

1.4
inline fun <K, V> Iterable<K>.associateWith(valueSelector: (K) -> V): Map<K, V>

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

Since Kotlin

1.3
associateWithTo
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 <V, M : MutableMap<in Boolean, in V>> BooleanArray.associateWithTo(destination: M, valueSelector: (Boolean) -> V): M
inline fun <V, M : MutableMap<in Byte, in V>> ByteArray.associateWithTo(destination: M, valueSelector: (Byte) -> V): M
inline fun <V, M : MutableMap<in Char, in V>> CharArray.associateWithTo(destination: M, valueSelector: (Char) -> V): M
inline fun <V, M : MutableMap<in Double, in V>> DoubleArray.associateWithTo(destination: M, valueSelector: (Double) -> V): M
inline fun <V, M : MutableMap<in Float, in V>> FloatArray.associateWithTo(destination: M, valueSelector: (Float) -> V): M
inline fun <V, M : MutableMap<in Int, in V>> IntArray.associateWithTo(destination: M, valueSelector: (Int) -> V): M
inline fun <V, M : MutableMap<in Long, in V>> LongArray.associateWithTo(destination: M, valueSelector: (Long) -> V): M
inline fun <V, M : MutableMap<in Short, in V>> ShortArray.associateWithTo(destination: M, valueSelector: (Short) -> V): M
inline fun <V, M : MutableMap<in UByte, in V>> UByteArray.associateWithTo(destination: M, valueSelector: (UByte) -> V): M
inline fun <V, M : MutableMap<in UInt, in V>> UIntArray.associateWithTo(destination: M, valueSelector: (UInt) -> V): M
inline fun <V, M : MutableMap<in ULong, in V>> ULongArray.associateWithTo(destination: M, valueSelector: (ULong) -> V): M
inline fun <V, M : MutableMap<in UShort, in V>> UShortArray.associateWithTo(destination: M, valueSelector: (UShort) -> 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.

Since Kotlin

1.4
inline fun <K, V, M : MutableMap<in K, in V>> Iterable<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 collection, where key is the element itself and value is provided by the valueSelector function applied to that key.

Since Kotlin

1.3
asUByteArray
Link copied to clipboard
inline fun ByteArray.asUByteArray(): UByteArray

Returns an array of type UByteArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
asUIntArray
Link copied to clipboard
inline fun IntArray.asUIntArray(): UIntArray

Returns an array of type UIntArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
asULongArray
Link copied to clipboard
inline fun LongArray.asULongArray(): ULongArray

Returns an array of type ULongArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
asUShortArray
Link copied to clipboard
inline fun ShortArray.asUShortArray(): UShortArray

Returns an array of type UShortArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

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

Returns an average value of elements in the array.

@JvmName(name = "averageOfByte")
fun Iterable<Byte>.average(): Double
@JvmName(name = "averageOfDouble")
fun Iterable<Double>.average(): Double
@JvmName(name = "averageOfFloat")
fun Iterable<Float>.average(): Double
@JvmName(name = "averageOfInt")
fun Iterable<Int>.average(): Double
@JvmName(name = "averageOfLong")
fun Iterable<Long>.average(): Double
@JvmName(name = "averageOfShort")
fun Iterable<Short>.average(): Double

Returns an average value of elements in the collection.

binarySearch
Link copied to clipboard
fun <T> List<T>.binarySearch(fromIndex: Int = 0, toIndex: Int = size, comparison: (T) -> Int): Int

Searches this list or its range for an element for which the given comparison function returns zero using the binary search algorithm.

fun <T : Comparable<T>> List<T?>.binarySearch(element: T?, fromIndex: Int = 0, toIndex: Int = size): Int

Searches this list or its range for the provided element using the binary search algorithm. The list is expected to be sorted into ascending order according to the Comparable natural ordering of its elements, otherwise the result is undefined.

fun <T> List<T>.binarySearch(element: T, comparator: Comparator<in T>, fromIndex: Int = 0, toIndex: Int = size): Int

Searches this list or its range for the provided element using the binary search algorithm. The list is expected to be sorted into ascending order 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 ByteArray.binarySearch(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Int
fun CharArray.binarySearch(element: Char, fromIndex: Int = 0, toIndex: Int = size): Int
fun DoubleArray.binarySearch(element: Double, fromIndex: Int = 0, toIndex: Int = size): Int
fun FloatArray.binarySearch(element: Float, fromIndex: Int = 0, toIndex: Int = size): Int
fun IntArray.binarySearch(element: Int, fromIndex: Int = 0, toIndex: Int = size): Int
fun LongArray.binarySearch(element: Long, fromIndex: Int = 0, toIndex: Int = size): Int
fun ShortArray.binarySearch(element: Short, 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.

@ExperimentalUnsignedTypes
fun UByteArray.binarySearch(element: UByte, fromIndex: Int = 0, toIndex: Int = size): Int
@ExperimentalUnsignedTypes
fun UIntArray.binarySearch(element: UInt, fromIndex: Int = 0, toIndex: Int = size): Int
@ExperimentalUnsignedTypes
fun ULongArray.binarySearch(element: ULong, fromIndex: Int = 0, toIndex: Int = size): Int
@ExperimentalUnsignedTypes
fun UShortArray.binarySearch(element: UShort, 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.

Since Kotlin

1.3
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.

binarySearchBy
Link copied to clipboard
inline fun <T, K : Comparable<K>> List<T>.binarySearchBy(key: K?, fromIndex: Int = 0, toIndex: Int = size, crossinline selector: (T) -> K?): Int

Searches this list or its range for an element having the key returned by the specified selector function equal to the provided key value using the binary search algorithm. The list is expected to be sorted into ascending order according to the Comparable natural ordering of keys of its elements. otherwise the result is undefined.

buildList
Link copied to clipboard
inline fun <E> buildList(builderAction: MutableList<E>.() -> Unit): List<E>
inline fun <E> buildList(capacity: Int, builderAction: MutableList<E>.() -> Unit): List<E>

Builds a new read-only List by populating a MutableList using the given builderAction and returning a read-only list with the same elements.

Since Kotlin

1.3
buildMap
Link copied to clipboard
inline fun <K, V> buildMap(builderAction: MutableMap<K, V>.() -> Unit): Map<K, V>
inline fun <K, V> buildMap(capacity: Int, builderAction: MutableMap<K, V>.() -> Unit): Map<K, V>

Builds a new read-only Map by populating a MutableMap using the given builderAction and returning a read-only map with the same key-value pairs.

Since Kotlin

1.3
buildSet
Link copied to clipboard
inline fun <E> buildSet(builderAction: MutableSet<E>.() -> Unit): Set<E>
inline fun <E> buildSet(capacity: Int, builderAction: MutableSet<E>.() -> Unit): Set<E>

Builds a new read-only Set by populating a MutableSet using the given builderAction and returning a read-only set with the same elements.

Since Kotlin

1.3
chunked
Link copied to clipboard
fun <T> Iterable<T>.chunked(size: Int): List<List<T>>

Splits this collection into a list of lists each not exceeding the given size.

Since Kotlin

1.2
fun <T, R> Iterable<T>.chunked(size: Int, transform: (List<T>) -> R): List<R>

Splits this collection into several lists each not exceeding the given size and applies the given transform function to an each.

Since Kotlin

1.2
component1
Link copied to clipboard
inline operator fun <T> Array<out T>.component1(): T
inline operator fun BooleanArray.component1(): Boolean
inline operator fun ByteArray.component1(): Byte
inline operator fun CharArray.component1(): Char
inline operator fun DoubleArray.component1(): Double
inline operator fun FloatArray.component1(): Float
inline operator fun IntArray.component1(): Int
inline operator fun LongArray.component1(): Long
inline operator fun ShortArray.component1(): Short

Returns 1st element from the array.

inline operator fun UByteArray.component1(): UByte
inline operator fun UIntArray.component1(): UInt
inline operator fun ULongArray.component1(): ULong
inline operator fun UShortArray.component1(): UShort

Returns 1st element from the array.

Since Kotlin

1.3
inline operator fun <T> List<T>.component1(): T

Returns 1st element from the list.

inline operator fun <K, V> Map.Entry<K, V>.component1(): K

Returns the key component of the map entry.

component2
Link copied to clipboard
inline operator fun <T> Array<out T>.component2(): T
inline operator fun BooleanArray.component2(): Boolean
inline operator fun ByteArray.component2(): Byte
inline operator fun CharArray.component2(): Char
inline operator fun DoubleArray.component2(): Double
inline operator fun FloatArray.component2(): Float
inline operator fun IntArray.component2(): Int
inline operator fun LongArray.component2(): Long
inline operator fun ShortArray.component2(): Short

Returns 2nd element from the array.

inline operator fun UByteArray.component2(): UByte
inline operator fun UIntArray.component2(): UInt
inline operator fun ULongArray.component2(): ULong
inline operator fun UShortArray.component2(): UShort

Returns 2nd element from the array.

Since Kotlin

1.3
inline operator fun <T> List<T>.component2(): T

Returns 2nd element from the list.

inline operator fun <K, V> Map.Entry<K, V>.component2(): V

Returns the value component of the map entry.

component3
Link copied to clipboard
inline operator fun <T> Array<out T>.component3(): T
inline operator fun BooleanArray.component3(): Boolean
inline operator fun ByteArray.component3(): Byte
inline operator fun CharArray.component3(): Char
inline operator fun DoubleArray.component3(): Double
inline operator fun FloatArray.component3(): Float
inline operator fun IntArray.component3(): Int
inline operator fun LongArray.component3(): Long
inline operator fun ShortArray.component3(): Short

Returns 3rd element from the array.

inline operator fun UByteArray.component3(): UByte
inline operator fun UIntArray.component3(): UInt
inline operator fun ULongArray.component3(): ULong
inline operator fun UShortArray.component3(): UShort

Returns 3rd element from the array.

Since Kotlin

1.3
inline operator fun <T> List<T>.component3(): T

Returns 3rd element from the list.

component4
Link copied to clipboard
inline operator fun <T> Array<out T>.component4(): T
inline operator fun BooleanArray.component4(): Boolean
inline operator fun ByteArray.component4(): Byte
inline operator fun CharArray.component4(): Char
inline operator fun DoubleArray.component4(): Double
inline operator fun FloatArray.component4(): Float
inline operator fun IntArray.component4(): Int
inline operator fun LongArray.component4(): Long
inline operator fun ShortArray.component4(): Short

Returns 4th element from the array.

inline operator fun UByteArray.component4(): UByte
inline operator fun UIntArray.component4(): UInt
inline operator fun ULongArray.component4(): ULong
inline operator fun UShortArray.component4(): UShort

Returns 4th element from the array.

Since Kotlin

1.3
inline operator fun <T> List<T>.component4(): T

Returns 4th element from the list.

component5
Link copied to clipboard
inline operator fun <T> Array<out T>.component5(): T
inline operator fun BooleanArray.component5(): Boolean
inline operator fun ByteArray.component5(): Byte
inline operator fun CharArray.component5(): Char
inline operator fun DoubleArray.component5(): Double
inline operator fun FloatArray.component5(): Float
inline operator fun IntArray.component5(): Int
inline operator fun LongArray.component5(): Long
inline operator fun ShortArray.component5(): Short

Returns 5th element from the array.

inline operator fun UByteArray.component5(): UByte
inline operator fun UIntArray.component5(): UInt
inline operator fun ULongArray.component5(): ULong
inline operator fun UShortArray.component5(): UShort

Returns 5th element from the array.

Since Kotlin

1.3
inline operator fun <T> List<T>.component5(): T

Returns 5th element from the list.

contains
Link copied to clipboard
operator fun <T> Array<out T>.contains(element: T): Boolean
operator fun BooleanArray.contains(element: Boolean): Boolean
operator fun ByteArray.contains(element: Byte): Boolean
operator fun CharArray.contains(element: Char): Boolean
@DeprecatedSinceKotlin(warningSince = "1.4")
operator fun DoubleArray.contains(element: Double): Boolean
@DeprecatedSinceKotlin(warningSince = "1.4")
operator fun FloatArray.contains(element: Float): Boolean
operator fun IntArray.contains(element: Int): Boolean
operator fun LongArray.contains(element: Long): Boolean
operator fun ShortArray.contains(element: Short): Boolean

Returns true if element is found in the array.

operator fun <T> Iterable<T>.contains(element: T): Boolean

Returns true if element is found in the collection.

inline operator fun <K, V> Map<out K, V>.contains(key: K): Boolean

Checks if the map contains the given key.

containsAll
Link copied to clipboard
inline fun <T> Collection<T>.containsAll(elements: Collection<T>): Boolean

Checks if all elements in the specified collection are contained in this collection.

containsKey
Link copied to clipboard
inline fun <K> Map<out K, *>.containsKey(key: K): Boolean

Returns true if the map contains the specified key.

containsValue
Link copied to clipboard
inline fun <K, V> Map<K, V>.containsValue(value: V): Boolean

Returns true if the map maps one or more keys to the specified value.

contentDeepEquals
Link copied to clipboard
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
@JvmName(name = "contentDeepEqualsInline")
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.

Since Kotlin

1.1
@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.

Since Kotlin

1.4
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
contentDeepHashCode
Link copied to clipboard
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
@JvmName(name = "contentDeepHashCodeInline")
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.

Since Kotlin

1.1
@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.

Since Kotlin

1.4
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
contentDeepToString
Link copied to clipboard
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
@JvmName(name = "contentDeepToStringInline")
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.

Since Kotlin

1.1
@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.

Since Kotlin

1.4
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
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.

Since Kotlin

1.1
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.

Since Kotlin

1.4
contentEquals
Link copied to clipboard
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun ByteArray.contentEquals(other: ByteArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun CharArray.contentEquals(other: CharArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun FloatArray.contentEquals(other: FloatArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun IntArray.contentEquals(other: IntArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun LongArray.contentEquals(other: LongArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect infix fun ShortArray.contentEquals(other: ShortArray): 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.

Since Kotlin

1.1
expect infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
expect infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
expect infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
expect infix fun CharArray?.contentEquals(other: CharArray?): Boolean
expect infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
expect infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
expect infix fun IntArray?.contentEquals(other: IntArray?): Boolean
expect infix fun LongArray?.contentEquals(other: LongArray?): Boolean
expect infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean
infix fun UByteArray?.contentEquals(other: UByteArray?): Boolean
infix fun UIntArray?.contentEquals(other: UIntArray?): Boolean
infix fun ULongArray?.contentEquals(other: ULongArray?): Boolean
infix fun UShortArray?.contentEquals(other: UShortArray?): 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.

Since Kotlin

1.4
infix fun UByteArray.contentEquals(other: UByteArray): Boolean
infix fun UIntArray.contentEquals(other: UIntArray): Boolean
infix fun ULongArray.contentEquals(other: ULongArray): Boolean
infix fun UShortArray.contentEquals(other: UShortArray): 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.

Since Kotlin

1.3
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun BooleanArray.contentEquals(other: BooleanArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun ByteArray.contentEquals(other: ByteArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun CharArray.contentEquals(other: CharArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun DoubleArray.contentEquals(other: DoubleArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun FloatArray.contentEquals(other: FloatArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun IntArray.contentEquals(other: IntArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun LongArray.contentEquals(other: LongArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix inline fun ShortArray.contentEquals(other: ShortArray): 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.

Since Kotlin

1.1
@JvmName(name = "contentEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun ByteArray?.contentEquals(other: ByteArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun CharArray?.contentEquals(other: CharArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun FloatArray?.contentEquals(other: FloatArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun IntArray?.contentEquals(other: IntArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun LongArray?.contentEquals(other: LongArray?): Boolean
@JvmName(name = "contentEqualsNullable")
actual infix inline fun ShortArray?.contentEquals(other: ShortArray?): 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.

Since Kotlin

1.4
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun ByteArray.contentEquals(other: ByteArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun CharArray.contentEquals(other: CharArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun FloatArray.contentEquals(other: FloatArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun IntArray.contentEquals(other: IntArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun LongArray.contentEquals(other: LongArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun ShortArray.contentEquals(other: ShortArray): 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.

Since Kotlin

1.1
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix fun ShortArray?.contentEquals(other: ShortArray?): 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.

Since Kotlin

1.4
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun ByteArray.contentEquals(other: ByteArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun CharArray.contentEquals(other: CharArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun FloatArray.contentEquals(other: FloatArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun IntArray.contentEquals(other: IntArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun LongArray.contentEquals(other: LongArray): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual infix fun ShortArray.contentEquals(other: ShortArray): 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.

Since Kotlin

1.1
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix fun ShortArray?.contentEquals(other: ShortArray?): 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.

Since Kotlin

1.4
contentHashCode
Link copied to clipboard
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun <T> Array<out T>.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun BooleanArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun ByteArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun CharArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun DoubleArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun FloatArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun IntArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun LongArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun ShortArray.contentHashCode(): Int

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

Since Kotlin

1.1
expect fun <T> Array<out T>?.contentHashCode(): Int
expect fun BooleanArray?.contentHashCode(): Int
expect fun ByteArray?.contentHashCode(): Int
expect fun CharArray?.contentHashCode(): Int
expect fun DoubleArray?.contentHashCode(): Int
expect fun FloatArray?.contentHashCode(): Int
expect fun IntArray?.contentHashCode(): Int
expect fun LongArray?.contentHashCode(): Int
expect fun ShortArray?.contentHashCode(): Int
fun UByteArray?.contentHashCode(): Int
fun UIntArray?.contentHashCode(): Int
fun ULongArray?.contentHashCode(): Int
fun UShortArray?.contentHashCode(): Int

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

Since Kotlin

1.4
fun UByteArray.contentHashCode(): Int
fun UIntArray.contentHashCode(): Int
fun ULongArray.contentHashCode(): Int
fun UShortArray.contentHashCode(): Int

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

Since Kotlin

1.3
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun <T> Array<out T>.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun BooleanArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun ByteArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun CharArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun DoubleArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun FloatArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun IntArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun LongArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun ShortArray.contentHashCode(): Int

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

Since Kotlin

1.1
@JvmName(name = "contentHashCodeNullable")
actual inline fun <T> Array<out T>?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun BooleanArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun ByteArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun CharArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun DoubleArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun FloatArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun IntArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun LongArray?.contentHashCode(): Int
@JvmName(name = "contentHashCodeNullable")
actual inline fun ShortArray?.contentHashCode(): Int

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

Since Kotlin

1.4
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun <T> Array<out T>.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun BooleanArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ByteArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun CharArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun DoubleArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun FloatArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun IntArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun LongArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ShortArray.contentHashCode(): Int

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

Since Kotlin

1.1
actual fun <T> Array<out T>?.contentHashCode(): Int
actual fun BooleanArray?.contentHashCode(): Int
actual fun ByteArray?.contentHashCode(): Int
actual fun CharArray?.contentHashCode(): Int
actual fun DoubleArray?.contentHashCode(): Int
actual fun FloatArray?.contentHashCode(): Int
actual fun IntArray?.contentHashCode(): Int
actual fun LongArray?.contentHashCode(): Int
actual fun ShortArray?.contentHashCode(): Int

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

Since Kotlin

1.4
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun <T> Array<out T>.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun BooleanArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ByteArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun CharArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun DoubleArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun FloatArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun IntArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun LongArray.contentHashCode(): Int
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ShortArray.contentHashCode(): Int

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

Since Kotlin

1.1
actual fun <T> Array<out T>?.contentHashCode(): Int
actual fun BooleanArray?.contentHashCode(): Int
actual fun ByteArray?.contentHashCode(): Int
actual fun CharArray?.contentHashCode(): Int
actual fun DoubleArray?.contentHashCode(): Int
actual fun FloatArray?.contentHashCode(): Int
actual fun IntArray?.contentHashCode(): Int
actual fun LongArray?.contentHashCode(): Int
actual fun ShortArray?.contentHashCode(): Int

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

Since Kotlin

1.4
contentToString
Link copied to clipboard
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun <T> Array<out T>.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun BooleanArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun ByteArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun CharArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun DoubleArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun FloatArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun IntArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun LongArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
expect fun ShortArray.contentToString(): String

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

Since Kotlin

1.1
expect fun <T> Array<out T>?.contentToString(): String
expect fun BooleanArray?.contentToString(): String
expect fun ByteArray?.contentToString(): String
expect fun CharArray?.contentToString(): String
expect fun DoubleArray?.contentToString(): String
expect fun FloatArray?.contentToString(): String
expect fun IntArray?.contentToString(): String
expect fun LongArray?.contentToString(): String
expect fun ShortArray?.contentToString(): String
fun UByteArray?.contentToString(): String
fun UIntArray?.contentToString(): String
fun ULongArray?.contentToString(): String
fun UShortArray?.contentToString(): String

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

Since Kotlin

1.4
fun UByteArray.contentToString(): String
fun UIntArray.contentToString(): String
fun ULongArray.contentToString(): String
fun UShortArray.contentToString(): String

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

Since Kotlin

1.3
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun <T> Array<out T>.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun BooleanArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun ByteArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun CharArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun DoubleArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun FloatArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun IntArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun LongArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual inline fun ShortArray.contentToString(): String

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

Since Kotlin

1.1
@JvmName(name = "contentToStringNullable")
actual inline fun <T> Array<out T>?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun BooleanArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun ByteArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun CharArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun DoubleArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun FloatArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun IntArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun LongArray?.contentToString(): String
@JvmName(name = "contentToStringNullable")
actual inline fun ShortArray?.contentToString(): String

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

Since Kotlin

1.4
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun <T> Array<out T>.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun BooleanArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ByteArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun CharArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun DoubleArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun FloatArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun IntArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun LongArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ShortArray.contentToString(): String

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

Since Kotlin

1.1
actual fun <T> Array<out T>?.contentToString(): String
actual fun BooleanArray?.contentToString(): String
actual fun ByteArray?.contentToString(): String
actual fun CharArray?.contentToString(): String
actual fun DoubleArray?.contentToString(): String
actual fun FloatArray?.contentToString(): String
actual fun IntArray?.contentToString(): String
actual fun LongArray?.contentToString(): String
actual fun ShortArray?.contentToString(): String

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

Since Kotlin

1.4
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun <T> Array<out T>.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun BooleanArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ByteArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun CharArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun DoubleArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun FloatArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun IntArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun LongArray.contentToString(): String
@DeprecatedSinceKotlin(hiddenSince = "1.4")
actual fun ShortArray.contentToString(): String

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

Since Kotlin

1.1
actual fun <T> Array<out T>?.contentToString(): String
actual fun BooleanArray?.contentToString(): String
actual fun ByteArray?.contentToString(): String
actual fun CharArray?.contentToString(): String
actual fun DoubleArray?.contentToString(): String
actual fun FloatArray?.contentToString(): String
actual fun IntArray?.contentToString(): String
actual fun LongArray?.contentToString(): String
actual fun ShortArray?.contentToString(): String

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

Since Kotlin

1.4
copyInto
Link copied to clipboard
expect fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int, startIndex: Int, endIndex: Int): Array<T>
expect fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int, startIndex: Int, endIndex: Int): BooleanArray
expect fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ByteArray
expect fun CharArray.copyInto(destination: CharArray, destinationOffset: Int, startIndex: Int, endIndex: Int): CharArray
expect fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int, startIndex: Int, endIndex: Int): DoubleArray
expect fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int, startIndex: Int, endIndex: Int): FloatArray
expect fun IntArray.copyInto(destination: IntArray, destinationOffset: Int, startIndex: Int, endIndex: Int): IntArray
expect fun LongArray.copyInto(destination: LongArray, destinationOffset: Int, startIndex: Int, endIndex: Int): LongArray
expect fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ShortArray
inline fun UByteArray.copyInto(destination: UByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UByteArray
inline fun UIntArray.copyInto(destination: UIntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UIntArray
inline fun ULongArray.copyInto(destination: ULongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ULongArray
inline fun UShortArray.copyInto(destination: UShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UShortArray

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

Since Kotlin

1.3
actual fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int, startIndex: Int, endIndex: Int): Array<T>
actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int, startIndex: Int, endIndex: Int): BooleanArray
actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ByteArray
actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int, startIndex: Int, endIndex: Int): CharArray
actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int, startIndex: Int, endIndex: Int): DoubleArray
actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int, startIndex: Int, endIndex: Int): FloatArray
actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int, startIndex: Int, endIndex: Int): IntArray
actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int, startIndex: Int, endIndex: Int): LongArray
actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ShortArray

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

Since Kotlin

1.3
actual inline fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int, startIndex: Int, endIndex: Int): Array<T>
actual inline fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int, startIndex: Int, endIndex: Int): BooleanArray
actual inline fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ByteArray
actual inline fun CharArray.copyInto(destination: CharArray, destinationOffset: Int, startIndex: Int, endIndex: Int): CharArray
actual inline fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int, startIndex: Int, endIndex: Int): DoubleArray
actual inline fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int, startIndex: Int, endIndex: Int): FloatArray
actual inline fun IntArray.copyInto(destination: IntArray, destinationOffset: Int, startIndex: Int, endIndex: Int): IntArray
actual inline fun LongArray.copyInto(destination: LongArray, destinationOffset: Int, startIndex: Int, endIndex: Int): LongArray
actual inline fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ShortArray

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

Since Kotlin

1.3
actual fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int, startIndex: Int, endIndex: Int): Array<T>
actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int, startIndex: Int, endIndex: Int): BooleanArray
actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ByteArray
actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int, startIndex: Int, endIndex: Int): CharArray
actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int, startIndex: Int, endIndex: Int): DoubleArray
actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int, startIndex: Int, endIndex: Int): FloatArray
actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int, startIndex: Int, endIndex: Int): IntArray
actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int, startIndex: Int, endIndex: Int): LongArray
actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int, startIndex: Int, endIndex: Int): ShortArray

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

Since Kotlin

1.3
copyOf
Link copied to clipboard
expect fun <T> Array<T>.copyOf(): Array<T>
expect fun BooleanArray.copyOf(): BooleanArray
expect fun ByteArray.copyOf(): ByteArray
expect fun CharArray.copyOf(): CharArray
expect fun DoubleArray.copyOf(): DoubleArray
expect fun FloatArray.copyOf(): FloatArray
expect fun IntArray.copyOf(): IntArray
expect fun LongArray.copyOf(): LongArray
expect fun ShortArray.copyOf(): ShortArray

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

inline fun UByteArray.copyOf(): UByteArray
inline fun UIntArray.copyOf(): UIntArray
inline fun ULongArray.copyOf(): ULongArray
inline fun UShortArray.copyOf(): UShortArray

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

Since Kotlin

1.3
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.

expect fun BooleanArray.copyOf(newSize: Int): BooleanArray

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 false values if necessary.

expect fun ByteArray.copyOf(newSize: Int): ByteArray
expect fun DoubleArray.copyOf(newSize: Int): DoubleArray
expect fun FloatArray.copyOf(newSize: Int): FloatArray
expect fun IntArray.copyOf(newSize: Int): IntArray
expect fun LongArray.copyOf(newSize: Int): LongArray
expect fun ShortArray.copyOf(newSize: Int): ShortArray

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 zero values if necessary.

expect fun CharArray.copyOf(newSize: Int): CharArray

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 char (\u0000) values if necessary.

inline fun UByteArray.copyOf(newSize: Int): UByteArray
inline fun UIntArray.copyOf(newSize: Int): UIntArray
inline fun ULongArray.copyOf(newSize: Int): ULongArray
inline fun UShortArray.copyOf(newSize: Int): UShortArray

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 zero values if necessary.

Since Kotlin

1.3
actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun BooleanArray.copyOf(): BooleanArray
actual inline fun ByteArray.copyOf(): ByteArray
actual inline fun CharArray.copyOf(): CharArray
actual inline fun DoubleArray.copyOf(): DoubleArray
actual inline fun FloatArray.copyOf(): FloatArray
actual inline fun IntArray.copyOf(): IntArray
actual inline fun LongArray.copyOf(): LongArray
actual inline fun ShortArray.copyOf(): ShortArray

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

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 BooleanArray.copyOf(newSize: Int): BooleanArray

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 false values if necessary.

actual inline fun ByteArray.copyOf(newSize: Int): ByteArray
actual inline fun DoubleArray.copyOf(newSize: Int): DoubleArray
actual inline fun FloatArray.copyOf(newSize: Int): FloatArray
actual inline fun IntArray.copyOf(newSize: Int): IntArray
actual inline fun LongArray.copyOf(newSize: Int): LongArray
actual inline fun ShortArray.copyOf(newSize: Int): ShortArray

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 zero values if necessary.

actual inline fun CharArray.copyOf(newSize: Int): CharArray

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 char (\u0000) values if necessary.

actual inline fun <T> Array<T>.copyOf(): Array<T>
actual fun BooleanArray.copyOf(): BooleanArray
actual inline fun ByteArray.copyOf(): ByteArray
actual fun CharArray.copyOf(): CharArray
actual inline fun DoubleArray.copyOf(): DoubleArray
actual inline fun FloatArray.copyOf(): FloatArray
actual inline fun IntArray.copyOf(): IntArray
actual fun LongArray.copyOf(): LongArray
actual inline fun ShortArray.copyOf(): ShortArray

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

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 BooleanArray.copyOf(newSize: Int): BooleanArray

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 false values if necessary.

actual fun ByteArray.copyOf(newSize: Int): ByteArray
actual fun DoubleArray.copyOf(newSize: Int): DoubleArray
actual fun FloatArray.copyOf(newSize: Int): FloatArray
actual fun IntArray.copyOf(newSize: Int): IntArray
actual fun LongArray.copyOf(newSize: Int): LongArray
actual fun ShortArray.copyOf(newSize: Int): ShortArray

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 zero values if necessary.

actual fun CharArray.copyOf(newSize: Int): CharArray

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 char (\u0000) values if necessary.

actual fun <T> Array<T>.copyOf(): Array<T>
actual fun BooleanArray.copyOf(): BooleanArray
actual fun ByteArray.copyOf(): ByteArray
actual fun CharArray.copyOf(): CharArray
actual fun DoubleArray.copyOf(): DoubleArray
actual fun FloatArray.copyOf(): FloatArray
actual fun IntArray.copyOf(): IntArray
actual fun LongArray.copyOf(): LongArray
actual fun ShortArray.copyOf(): ShortArray

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

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 BooleanArray.copyOf(newSize: Int): BooleanArray

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 false values if necessary.

actual fun ByteArray.copyOf(newSize: Int): ByteArray
actual fun DoubleArray.copyOf(newSize: Int): DoubleArray
actual fun FloatArray.copyOf(newSize: Int): FloatArray
actual fun IntArray.copyOf(newSize: Int): IntArray
actual fun LongArray.copyOf(newSize: Int): LongArray
actual fun ShortArray.copyOf(newSize: Int): ShortArray

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 zero values if necessary.

actual fun CharArray.copyOf(newSize: Int): CharArray

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 char (\u0000) values if necessary.

copyOfRange
Link copied to clipboard
expect fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
expect fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray
expect fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray
expect fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray
expect fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray
expect fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray
expect fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray
expect fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray
expect fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray

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

inline fun UByteArray.copyOfRange(fromIndex: Int, toIndex: Int): UByteArray
inline fun UIntArray.copyOfRange(fromIndex: Int, toIndex: Int): UIntArray
inline fun ULongArray.copyOfRange(fromIndex: Int, toIndex: Int): ULongArray
inline fun UShortArray.copyOfRange(fromIndex: Int, toIndex: Int): UShortArray

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

Since Kotlin

1.3
@JvmName(name = "copyOfRangeInline")
actual inline fun <T> Array<T>.copyOfRange(fromIndex: Int, toIndex: Int): Array<T>
@JvmName(name = "copyOfRangeInline")
actual inline fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray
@JvmName(name = "copyOfRangeInline")
actual inline fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray
@JvmName(name = "copyOfRangeInline")
actual inline fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray
@JvmName(name = "copyOfRangeInline")
actual inline fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray
@JvmName(name = "copyOfRangeInline")
actual inline fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray
@JvmName(name = "copyOfRangeInline")
actual inline fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray
@JvmName(name = "copyOfRangeInline")
actual inline fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray
@JvmName(name = "copyOfRangeInline")
actual inline fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray

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 BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray
actual fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray
actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray
actual fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray
actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray
actual fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray
actual fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray
actual fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray

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 BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray
actual fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray
actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray
actual fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray
actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray
actual fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray
actual fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray
actual fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray

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

count
Link copied to clipboard
inline fun <T> Array<out T>.count(): Int
inline fun BooleanArray.count(): Int
inline fun ByteArray.count(): Int
inline fun CharArray.count(): Int
inline fun DoubleArray.count(): Int
inline fun FloatArray.count(): Int
inline fun IntArray.count(): Int
inline fun LongArray.count(): Int
inline fun ShortArray.count(): Int

Returns the number of elements in this array.

inline fun <T> Collection<T>.count(): Int
fun <T> Iterable<T>.count(): Int

Returns the number of elements in this collection.

inline fun <K, V> Map<out K, V>.count(): Int

Returns the number of entries in this map.

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

Returns the number of elements matching the given predicate.

inline fun UByteArray.count(predicate: (UByte) -> Boolean): Int
inline fun UIntArray.count(predicate: (UInt) -> Boolean): Int
inline fun ULongArray.count(predicate: (ULong) -> Boolean): Int
inline fun UShortArray.count(predicate: (UShort) -> Boolean): Int

Returns the number of elements matching the given predicate.

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>.count(predicate: (Map.Entry<K, V>) -> Boolean): Int

Returns the number of entries matching the given predicate.

distinct
Link copied to clipboard
fun <T> Array<out T>.distinct(): List<T>
fun BooleanArray.distinct(): List<Boolean>
fun ByteArray.distinct(): List<Byte>
fun CharArray.distinct(): List<Char>
fun DoubleArray.distinct(): List<Double>
fun FloatArray.distinct(): List<Float>
fun IntArray.distinct(): List<Int>
fun LongArray.distinct(): List<Long>
fun ShortArray.distinct(): List<Short>

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

fun <T> Iterable<T>.distinct(): List<T>

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

distinctBy
Link copied to clipboard
inline fun <T, K> Array<out T>.distinctBy(selector: (T) -> K): List<T>
inline fun <K> BooleanArray.distinctBy(selector: (Boolean) -> K): List<Boolean>
inline fun <K> ByteArray.distinctBy(selector: (Byte) -> K): List<Byte>
inline fun <K> CharArray.distinctBy(selector: (Char) -> K): List<Char>
inline fun <K> DoubleArray.distinctBy(selector: (Double) -> K): List<Double>
inline fun <K> FloatArray.distinctBy(selector: (Float) -> K): List<Float>
inline fun <K> IntArray.distinctBy(selector: (Int) -> K): List<Int>
inline fun <K> LongArray.distinctBy(selector: (Long) -> K): List<Long>
inline fun <K> ShortArray.distinctBy(selector: (Short) -> K): List<Short>

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

inline fun <T, K> Iterable<T>.distinctBy(selector: (T) -> K): List<T>

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

drop
Link copied to clipboard
fun <T> Array<out T>.drop(n: Int): List<T>
fun BooleanArray.drop(n: Int): List<Boolean>
fun ByteArray.drop(n: Int): List<Byte>
fun CharArray.drop(n: Int): List<Char>
fun DoubleArray.drop(n: Int): List<Double>
fun FloatArray.drop(n: Int): List<Float>
fun IntArray.drop(n: Int): List<Int>
fun LongArray.drop(n: Int): List<Long>
fun ShortArray.drop(n: Int): List<Short>
fun <T> Iterable<T>.drop(n: Int): List<T>

Returns a list containing all elements except first n elements.

fun UByteArray.drop(n: Int): List<UByte>
fun UIntArray.drop(n: Int): List<UInt>
fun ULongArray.drop(n: Int): List<ULong>
fun UShortArray.drop(n: Int): List<UShort>

Returns a list containing all elements except first n elements.

Since Kotlin

1.3
dropLast
Link copied to clipboard
fun <T> Array<out T>.dropLast(n: Int): List<T>
fun BooleanArray.dropLast(n: Int): List<Boolean>
fun ByteArray.dropLast(n: Int): List<Byte>
fun CharArray.dropLast(n: Int): List<Char>
fun DoubleArray.dropLast(n: Int): List<Double>
fun FloatArray.dropLast(n: Int): List<Float>
fun IntArray.dropLast(n: Int): List<Int>
fun LongArray.dropLast(n: Int): List<Long>
fun ShortArray.dropLast(n: Int): List<Short>
fun <T> List<T>.dropLast(n: Int): List<T>

Returns a list containing all elements except last n elements.

fun UByteArray.dropLast(n: Int): List<UByte>
fun UIntArray.dropLast(n: Int): List<UInt>
fun ULongArray.dropLast(n: Int): List<ULong>
fun UShortArray.dropLast(n: Int): List<UShort>

Returns a list containing all elements except last n elements.

Since Kotlin

1.3
dropLastWhile
Link copied to clipboard
inline fun <T> Array<out T>.dropLastWhile(predicate: (T) -> Boolean): List<T>
inline fun BooleanArray.dropLastWhile(predicate: (Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.dropLastWhile(predicate: (Byte) -> Boolean): List<Byte>
inline fun CharArray.dropLastWhile(predicate: (Char) -> Boolean): List<Char>
inline fun DoubleArray.dropLastWhile(predicate: (Double) -> Boolean): List<Double>
inline fun FloatArray.dropLastWhile(predicate: (Float) -> Boolean): List<Float>
inline fun IntArray.dropLastWhile(predicate: (Int) -> Boolean): List<Int>
inline fun LongArray.dropLastWhile(predicate: (Long) -> Boolean): List<Long>
inline fun ShortArray.dropLastWhile(predicate: (Short) -> Boolean): List<Short>
inline fun <T> List<T>.dropLastWhile(predicate: (T) -> Boolean): List<T>

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

inline fun UByteArray.dropLastWhile(predicate: (UByte) -> Boolean): List<UByte>
inline fun UIntArray.dropLastWhile(predicate: (UInt) -> Boolean): List<UInt>
inline fun ULongArray.dropLastWhile(predicate: (ULong) -> Boolean): List<ULong>
inline fun UShortArray.dropLastWhile(predicate: (UShort) -> Boolean): List<UShort>

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

Since Kotlin

1.3
dropWhile
Link copied to clipboard
inline fun <T> Array<out T>.dropWhile(predicate: (T) -> Boolean): List<T>
inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List<Byte>
inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List<Char>
inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List<Double>
inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List<Float>
inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List<Int>
inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List<Long>
inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List<Short>
inline fun <T> Iterable<T>.dropWhile(predicate: (T) -> Boolean): List<T>

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

inline fun UByteArray.dropWhile(predicate: (UByte) -> Boolean): List<UByte>
inline fun UIntArray.dropWhile(predicate: (UInt) -> Boolean): List<UInt>
inline fun ULongArray.dropWhile(predicate: (ULong) -> Boolean): List<ULong>
inline fun UShortArray.dropWhile(predicate: (UShort) -> Boolean): List<UShort>

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

Since Kotlin

1.3
eachCount
Link copied to clipboard
expect fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int>
actual fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int>

Groups elements from the Grouping source by key and counts elements in each group.

Since Kotlin

1.1
actual fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int>

Groups elements from the Grouping source by key and counts elements in each group.

Since Kotlin

1.1
actual fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int>

Groups elements from the Grouping source by key and counts elements in each group.

Since Kotlin

1.1
eachCountTo
Link copied to clipboard
fun <T, K, M : MutableMap<in K, Int>> Grouping<T, K>.eachCountTo(destination: M): M

Groups elements from the Grouping source by key and counts elements in each group to the given destination map.

Since Kotlin

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

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

expect fun UByteArray.elementAt(index: Int): UByte
expect fun UIntArray.elementAt(index: Int): UInt
expect fun ULongArray.elementAt(index: Int): ULong
expect fun UShortArray.elementAt(index: Int): UShort

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

Since Kotlin

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

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

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

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

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

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

@ExperimentalUnsignedTypes
actual inline fun UByteArray.elementAt(index: Int): UByte
@ExperimentalUnsignedTypes
actual inline fun UIntArray.elementAt(index: Int): UInt
@ExperimentalUnsignedTypes
actual inline fun ULongArray.elementAt(index: Int): ULong
@ExperimentalUnsignedTypes
actual inline fun UShortArray.elementAt(index: Int): UShort

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

Since Kotlin

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

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

@ExperimentalUnsignedTypes
actual fun UByteArray.elementAt(index: Int): UByte
@ExperimentalUnsignedTypes
actual fun UIntArray.elementAt(index: Int): UInt
@ExperimentalUnsignedTypes
actual fun ULongArray.elementAt(index: Int): ULong
@ExperimentalUnsignedTypes
actual fun UShortArray.elementAt(index: Int): UShort

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

Since Kotlin

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

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

@ExperimentalUnsignedTypes
actual inline fun UByteArray.elementAt(index: Int): UByte
@ExperimentalUnsignedTypes
actual inline fun UIntArray.elementAt(index: Int): UInt
@ExperimentalUnsignedTypes
actual inline fun ULongArray.elementAt(index: Int): ULong
@ExperimentalUnsignedTypes
actual inline fun UShortArray.elementAt(index: Int): UShort

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

Since Kotlin

1.3
elementAtOrElse
Link copied to clipboard
inline fun <T> Array<out T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T
inline fun BooleanArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean
inline fun ByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Byte): Byte
inline fun CharArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char
inline fun DoubleArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Double): Double
inline fun FloatArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Float): Float
inline fun IntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Int): Int
inline fun LongArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Long): Long
inline fun ShortArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Short): Short

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.

inline fun UByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UByte): UByte
inline fun UIntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UInt): UInt
inline fun ULongArray.elementAtOrElse(index: Int, defaultValue: (Int) -> ULong): ULong
inline fun UShortArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UShort): UShort

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.

Since Kotlin

1.3
fun <T> Iterable<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 collection.

inline fun <T> List<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 list.

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

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

inline fun UByteArray.elementAtOrNull(index: Int): UByte?
inline fun UIntArray.elementAtOrNull(index: Int): UInt?
inline fun ULongArray.elementAtOrNull(index: Int): ULong?
inline fun UShortArray.elementAtOrNull(index: Int): UShort?

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

Since Kotlin

1.3
fun <T> Iterable<T>.elementAtOrNull(index: Int): T?

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

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

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

emptyList
Link copied to clipboard
fun <T> emptyList(): List<T>

Returns an empty read-only list. The returned list is serializable (JVM).

emptyMap
Link copied to clipboard
fun <K, V> emptyMap(): Map<K, V>

Returns an empty read-only map of specified type.

emptySet
Link copied to clipboard
fun <T> emptySet(): Set<T>

Returns an empty read-only set. The returned set is serializable (JVM).

fill
Link copied to clipboard
expect fun <T> MutableList<T>.fill(value: T)
expect fun <T> Array<T>.fill(element: T, fromIndex: Int, toIndex: Int)
expect fun BooleanArray.fill(element: Boolean, fromIndex: Int, toIndex: Int)
expect fun ByteArray.fill(element: Byte, fromIndex: Int, toIndex: Int)
expect fun CharArray.fill(element: Char, fromIndex: Int, toIndex: Int)
expect fun DoubleArray.fill(element: Double, fromIndex: Int, toIndex: Int)
expect fun FloatArray.fill(element: Float, fromIndex: Int, toIndex: Int)
expect fun IntArray.fill(element: Int, fromIndex: Int, toIndex: Int)
expect fun LongArray.fill(element: Long, fromIndex: Int, toIndex: Int)
expect fun ShortArray.fill(element: Short, fromIndex: Int, toIndex: Int)
fun UByteArray.fill(element: UByte, fromIndex: Int = 0, toIndex: Int = size)
fun UIntArray.fill(element: UInt, fromIndex: Int = 0, toIndex: Int = size)
fun ULongArray.fill(element: ULong, fromIndex: Int = 0, toIndex: Int = size)
fun UShortArray.fill(element: UShort, fromIndex: Int = 0, toIndex: Int = size)

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

Since Kotlin

1.3
actual inline fun <T> MutableList<T>.fill(value: T)

Fills the list with the provided value.

Since Kotlin

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

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

actual fun <T> MutableList<T>.fill(value: T)

Fills the list with the provided value.

Since Kotlin

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

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

Since Kotlin

1.3
actual fun <T> MutableList<T>.fill(value: T)

Fills the list with the provided value.

Since Kotlin

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

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

Since Kotlin

1.3
filter
Link copied to clipboard
inline fun <T> Array<out T>.filter(predicate: (T) -> Boolean): List<T>
inline fun BooleanArray.filter(predicate: (Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List<Byte>
inline fun CharArray.filter(predicate: (Char) -> Boolean): List<Char>
inline fun DoubleArray.filter(predicate: (Double) -> Boolean): List<Double>
inline fun FloatArray.filter(predicate: (Float) -> Boolean): List<Float>
inline fun IntArray.filter(predicate: (Int) -> Boolean): List<Int>
inline fun LongArray.filter(predicate: (Long) -> Boolean): List<Long>
inline fun ShortArray.filter(predicate: (Short) -> Boolean): List<Short>
inline fun <T> Iterable<T>.filter(predicate: (T) -> Boolean): List<T>

Returns a list containing only elements matching the given predicate.

inline fun UByteArray.filter(predicate: (UByte) -> Boolean): List<UByte>
inline fun UIntArray.filter(predicate: (UInt) -> Boolean): List<UInt>
inline fun ULongArray.filter(predicate: (ULong) -> Boolean): List<ULong>
inline fun UShortArray.filter(predicate: (UShort) -> Boolean): List<UShort>

Returns a list containing only elements matching the given predicate.

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>.filter(predicate: (Map.Entry<K, V>) -> Boolean): Map<K, V>

Returns a new map containing all key-value pairs matching the given predicate.

filterIndexed
Link copied to clipboard
inline fun <T> Array<out T>.filterIndexed(predicate: (index: Int, T) -> Boolean): List<T>
inline fun BooleanArray.filterIndexed(predicate: (index: Int, Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.filterIndexed(predicate: (index: Int, Byte) -> Boolean): List<Byte>
inline fun CharArray.filterIndexed(predicate: (index: Int, Char) -> Boolean): List<Char>
inline fun DoubleArray.filterIndexed(predicate: (index: Int, Double) -> Boolean): List<Double>
inline fun FloatArray.filterIndexed(predicate: (index: Int, Float) -> Boolean): List<Float>
inline fun IntArray.filterIndexed(predicate: (index: Int, Int) -> Boolean): List<Int>
inline fun LongArray.filterIndexed(predicate: (index: Int, Long) -> Boolean): List<Long>
inline fun ShortArray.filterIndexed(predicate: (index: Int, Short) -> Boolean): List<Short>
inline fun <T> Iterable<T>.filterIndexed(predicate: (index: Int, T) -> Boolean): List<T>

Returns a list containing only elements matching the given predicate.

inline fun UByteArray.filterIndexed(predicate: (index: Int, UByte) -> Boolean): List<UByte>
inline fun UIntArray.filterIndexed(predicate: (index: Int, UInt) -> Boolean): List<UInt>
inline fun ULongArray.filterIndexed(predicate: (index: Int, ULong) -> Boolean): List<ULong>
inline fun UShortArray.filterIndexed(predicate: (index: Int, UShort) -> Boolean): List<UShort>

Returns a list containing only elements matching the given predicate.

Since Kotlin

1.3
filterIndexedTo
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 <C : MutableCollection<in Boolean>> BooleanArray.filterIndexedTo(destination: C, predicate: (index: Int, Boolean) -> Boolean): C
inline fun <C : MutableCollection<in Byte>> ByteArray.filterIndexedTo(destination: C, predicate: (index: Int, Byte) -> Boolean): C
inline fun <C : MutableCollection<in Char>> CharArray.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C
inline fun <C : MutableCollection<in Double>> DoubleArray.filterIndexedTo(destination: C, predicate: (index: Int, Double) -> Boolean): C
inline fun <C : MutableCollection<in Float>> FloatArray.filterIndexedTo(destination: C, predicate: (index: Int, Float) -> Boolean): C
inline fun <C : MutableCollection<in Int>> IntArray.filterIndexedTo(destination: C, predicate: (index: Int, Int) -> Boolean): C
inline fun <C : MutableCollection<in Long>> LongArray.filterIndexedTo(destination: C, predicate: (index: Int, Long) -> Boolean): C
inline fun <C : MutableCollection<in Short>> ShortArray.filterIndexedTo(destination: C, predicate: (index: Int, Short) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C

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

inline fun <C : MutableCollection<in UByte>> UByteArray.filterIndexedTo(destination: C, predicate: (index: Int, UByte) -> Boolean): C
inline fun <C : MutableCollection<in UInt>> UIntArray.filterIndexedTo(destination: C, predicate: (index: Int, UInt) -> Boolean): C
inline fun <C : MutableCollection<in ULong>> ULongArray.filterIndexedTo(destination: C, predicate: (index: Int, ULong) -> Boolean): C
inline fun <C : MutableCollection<in UShort>> UShortArray.filterIndexedTo(destination: C, predicate: (index: Int, UShort) -> Boolean): C

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

Since Kotlin

1.3
filterIsInstance
Link copied to clipboard
inline fun <R> Array<*>.filterIsInstance(): List<R>
inline fun <R> Iterable<*>.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> Iterable<*>.filterIsInstance(klass: Class<R>): List<R>

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

filterIsInstanceTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> Array<*>.filterIsInstanceTo(destination: C): C
inline fun <R, C : MutableCollection<in R>> Iterable<*>.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> Iterable<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C

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

filterKeys
Link copied to clipboard
inline fun <K, V> Map<out K, V>.filterKeys(predicate: (K) -> Boolean): Map<K, V>

Returns a map containing all key-value pairs with keys matching the given predicate.

filterNot
Link copied to clipboard
inline fun <T> Array<out T>.filterNot(predicate: (T) -> Boolean): List<T>
inline fun BooleanArray.filterNot(predicate: (Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.filterNot(predicate: (Byte) -> Boolean): List<Byte>
inline fun CharArray.filterNot(predicate: (Char) -> Boolean): List<Char>
inline fun DoubleArray.filterNot(predicate: (Double) -> Boolean): List<Double>
inline fun FloatArray.filterNot(predicate: (Float) -> Boolean): List<Float>
inline fun IntArray.filterNot(predicate: (Int) -> Boolean): List<Int>
inline fun LongArray.filterNot(predicate: (Long) -> Boolean): List<Long>
inline fun ShortArray.filterNot(predicate: (Short) -> Boolean): List<Short>
inline fun <T> Iterable<T>.filterNot(predicate: (T) -> Boolean): List<T>

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

inline fun UByteArray.filterNot(predicate: (UByte) -> Boolean): List<UByte>
inline fun UIntArray.filterNot(predicate: (UInt) -> Boolean): List<UInt>
inline fun ULongArray.filterNot(predicate: (ULong) -> Boolean): List<ULong>
inline fun UShortArray.filterNot(predicate: (UShort) -> Boolean): List<UShort>

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

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>.filterNot(predicate: (Map.Entry<K, V>) -> Boolean): Map<K, V>

Returns a new map containing all key-value pairs not matching the given predicate.

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

Returns a list containing all elements that are not null.

filterNotNullTo
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> Iterable<T?>.filterNotNullTo(destination: C): C

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

filterNotTo
Link copied to clipboard
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C
inline fun <C : MutableCollection<in Boolean>> BooleanArray.filterNotTo(destination: C, predicate: (Boolean) -> Boolean): C
inline fun <C : MutableCollection<in Byte>> ByteArray.filterNotTo(destination: C, predicate: (Byte) -> Boolean): C
inline fun <C : MutableCollection<in Char>> CharArray.filterNotTo(destination: C, predicate: (Char) -> Boolean): C
inline fun <C : MutableCollection<in Double>> DoubleArray.filterNotTo(destination: C, predicate: (Double) -> Boolean): C
inline fun <C : MutableCollection<in Float>> FloatArray.filterNotTo(destination: C, predicate: (Float) -> Boolean): C
inline fun <C : MutableCollection<in Int>> IntArray.filterNotTo(destination: C, predicate: (Int) -> Boolean): C
inline fun <C : MutableCollection<in Long>> LongArray.filterNotTo(destination: C, predicate: (Long) -> Boolean): C
inline fun <C : MutableCollection<in Short>> ShortArray.filterNotTo(destination: C, predicate: (Short) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C

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

inline fun <C : MutableCollection<in UByte>> UByteArray.filterNotTo(destination: C, predicate: (UByte) -> Boolean): C
inline fun <C : MutableCollection<in UInt>> UIntArray.filterNotTo(destination: C, predicate: (UInt) -> Boolean): C
inline fun <C : MutableCollection<in ULong>> ULongArray.filterNotTo(destination: C, predicate: (ULong) -> Boolean): C
inline fun <C : MutableCollection<in UShort>> UShortArray.filterNotTo(destination: C, predicate: (UShort) -> Boolean): C

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

Since Kotlin

1.3
inline fun <K, V, M : MutableMap<in K, in V>> Map<out K, V>.filterNotTo(destination: M, predicate: (Map.Entry<K, V>) -> Boolean): M

Appends all entries not matching the given predicate into the given destination.

filterTo
Link copied to clipboard
inline fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(destination: C, predicate: (T) -> Boolean): C
inline fun <C : MutableCollection<in Boolean>> BooleanArray.filterTo(destination: C, predicate: (Boolean) -> Boolean): C
inline fun <C : MutableCollection<in Byte>> ByteArray.filterTo(destination: C, predicate: (Byte) -> Boolean): C
inline fun <C : MutableCollection<in Char>> CharArray.filterTo(destination: C, predicate: (Char) -> Boolean): C
inline fun <C : MutableCollection<in Double>> DoubleArray.filterTo(destination: C, predicate: (Double) -> Boolean): C
inline fun <C : MutableCollection<in Float>> FloatArray.filterTo(destination: C, predicate: (Float) -> Boolean): C
inline fun <C : MutableCollection<in Int>> IntArray.filterTo(destination: C, predicate: (Int) -> Boolean): C
inline fun <C : MutableCollection<in Long>> LongArray.filterTo(destination: C, predicate: (Long) -> Boolean): C
inline fun <C : MutableCollection<in Short>> ShortArray.filterTo(destination: C, predicate: (Short) -> Boolean): C
inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterTo(destination: C, predicate: (T) -> Boolean): C

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

inline fun <C : MutableCollection<in UByte>> UByteArray.filterTo(destination: C, predicate: (UByte) -> Boolean): C
inline fun <C : MutableCollection<in UInt>> UIntArray.filterTo(destination: C, predicate: (UInt) -> Boolean): C
inline fun <C : MutableCollection<in ULong>> ULongArray.filterTo(destination: C, predicate: (ULong) -> Boolean): C
inline fun <C : MutableCollection<in UShort>> UShortArray.filterTo(destination: C, predicate: (UShort) -> Boolean): C

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

Since Kotlin

1.3
inline fun <K, V, M : MutableMap<in K, in V>> Map<out K, V>.filterTo(destination: M, predicate: (Map.Entry<K, V>) -> Boolean): M

Appends all entries matching the given predicate into the mutable map given as destination parameter.

filterValues
Link copied to clipboard
inline fun <K, V> Map<out K, V>.filterValues(predicate: (V) -> Boolean): Map<K, V>

Returns a map containing all key-value pairs with values matching the given predicate.

find
Link copied to clipboard
inline fun <T> Array<out T>.find(predicate: (T) -> Boolean): T?
inline fun BooleanArray.find(predicate: (Boolean) -> Boolean): Boolean?
inline fun ByteArray.find(predicate: (Byte) -> Boolean): Byte?
inline fun CharArray.find(predicate: (Char) -> Boolean): Char?
inline fun DoubleArray.find(predicate: (Double) -> Boolean): Double?
inline fun FloatArray.find(predicate: (Float) -> Boolean): Float?
inline fun IntArray.find(predicate: (Int) -> Boolean): Int?
inline fun LongArray.find(predicate: (Long) -> Boolean): Long?
inline fun ShortArray.find(predicate: (Short) -> Boolean): Short?
inline fun <T> Iterable<T>.find(predicate: (T) -> Boolean): T?

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

inline fun UByteArray.find(predicate: (UByte) -> Boolean): UByte?
inline fun UIntArray.find(predicate: (UInt) -> Boolean): UInt?
inline fun ULongArray.find(predicate: (ULong) -> Boolean): ULong?
inline fun UShortArray.find(predicate: (UShort) -> Boolean): UShort?

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

Since Kotlin

1.3
findLast
Link copied to clipboard
inline fun <T> Array<out T>.findLast(predicate: (T) -> Boolean): T?
inline fun BooleanArray.findLast(predicate: (Boolean) -> Boolean): Boolean?
inline fun ByteArray.findLast(predicate: (Byte) -> Boolean): Byte?
inline fun CharArray.findLast(predicate: (Char) -> Boolean): Char?
inline fun DoubleArray.findLast(predicate: (Double) -> Boolean): Double?
inline fun FloatArray.findLast(predicate: (Float) -> Boolean): Float?
inline fun IntArray.findLast(predicate: (Int) -> Boolean): Int?
inline fun LongArray.findLast(predicate: (Long) -> Boolean): Long?
inline fun ShortArray.findLast(predicate: (Short) -> Boolean): Short?
inline fun <T> Iterable<T>.findLast(predicate: (T) -> Boolean): T?
inline fun <T> List<T>.findLast(predicate: (T) -> Boolean): T?

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

inline fun UByteArray.findLast(predicate: (UByte) -> Boolean): UByte?
inline fun UIntArray.findLast(predicate: (UInt) -> Boolean): UInt?
inline fun ULongArray.findLast(predicate: (ULong) -> Boolean): ULong?
inline fun UShortArray.findLast(predicate: (UShort) -> Boolean): UShort?

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

Since Kotlin

1.3
first
Link copied to clipboard
fun <T> Array<out T>.first(): T
fun BooleanArray.first(): Boolean
fun ByteArray.first(): Byte
fun CharArray.first(): Char
fun DoubleArray.first(): Double
fun FloatArray.first(): Float
fun IntArray.first(): Int
fun LongArray.first(): Long
fun ShortArray.first(): Short
fun <T> Iterable<T>.first(): T
fun <T> List<T>.first(): T

Returns first element.

inline fun UByteArray.first(): UByte
inline fun UIntArray.first(): UInt
inline fun ULongArray.first(): ULong
inline fun UShortArray.first(): UShort

Returns first element.

Since Kotlin

1.3
inline fun <T> Array<out T>.first(predicate: (T) -> Boolean): T
inline fun BooleanArray.first(predicate: (Boolean) -> Boolean): Boolean
inline fun ByteArray.first(predicate: (Byte) -> Boolean): Byte
inline fun CharArray.first(predicate: (Char) -> Boolean): Char
inline fun DoubleArray.first(predicate: (Double) -> Boolean): Double
inline fun FloatArray.first(predicate: (Float) -> Boolean): Float
inline fun IntArray.first(predicate: (Int) -> Boolean): Int
inline fun LongArray.first(predicate: (Long) -> Boolean): Long
inline fun ShortArray.first(predicate: (Short) -> Boolean): Short
inline fun <T> Iterable<T>.first(predicate: (T) -> Boolean): T

Returns the first element matching the given predicate.

inline fun UByteArray.first(predicate: (UByte) -> Boolean): UByte
inline fun UIntArray.first(predicate: (UInt) -> Boolean): UInt
inline fun ULongArray.first(predicate: (ULong) -> Boolean): ULong
inline fun UShortArray.first(predicate: (UShort) -> Boolean): UShort

Returns the first element matching the given predicate.

Since Kotlin

1.3
firstNotNullOf
Link copied to clipboard
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.

Since Kotlin

1.5
inline fun <T, R : Any> Iterable<T>.firstNotNullOf(transform: (T) -> R?): R

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

Since Kotlin

1.5
inline fun <K, V, R : Any> Map<out K, V>.firstNotNullOf(transform: (Map.Entry<K, V>) -> R?): R

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

Since Kotlin

1.5
firstNotNullOfOrNull
Link copied to clipboard
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.

Since Kotlin

1.5
inline fun <T, R : Any> Iterable<T>.firstNotNullOfOrNull(transform: (T) -> R?): R?

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

Since Kotlin

1.5
inline fun <K, V, R : Any> Map<out K, V>.firstNotNullOfOrNull(transform: (Map.Entry<K, V>) -> R?): R?

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

Since Kotlin

1.5
firstOrNull
Link copied to clipboard
fun <T> Array<out T>.firstOrNull(): T?
fun BooleanArray.firstOrNull(): Boolean?
fun ByteArray.firstOrNull(): Byte?
fun CharArray.firstOrNull(): Char?
fun DoubleArray.firstOrNull(): Double?
fun FloatArray.firstOrNull(): Float?
fun IntArray.firstOrNull(): Int?
fun LongArray.firstOrNull(): Long?
fun ShortArray.firstOrNull(): Short?

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

fun UByteArray.firstOrNull(): UByte?
fun UIntArray.firstOrNull(): UInt?
fun ULongArray.firstOrNull(): ULong?
fun UShortArray.firstOrNull(): UShort?

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

Since Kotlin

1.3
fun <T> Iterable<T>.firstOrNull(): T?

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

fun <T> List<T>.firstOrNull(): T?

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

inline fun <T> Array<out T>.firstOrNull(predicate: (T) -> Boolean): T?
inline fun BooleanArray.firstOrNull(predicate: (Boolean) -> Boolean): Boolean?
inline fun ByteArray.firstOrNull(predicate: (Byte) -> Boolean): Byte?
inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char?
inline fun DoubleArray.firstOrNull(predicate: (Double) -> Boolean): Double?
inline fun FloatArray.firstOrNull(predicate: (Float) -> Boolean): Float?
inline fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int?
inline fun LongArray.firstOrNull(predicate: (Long) -> Boolean): Long?
inline fun ShortArray.firstOrNull(predicate: (Short) -> Boolean): Short?
inline fun <T> Iterable<T>.firstOrNull(predicate: (T) -> Boolean): T?

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

inline fun UByteArray.firstOrNull(predicate: (UByte) -> Boolean): UByte?
inline fun UIntArray.firstOrNull(predicate: (UInt) -> Boolean): UInt?
inline fun ULongArray.firstOrNull(predicate: (ULong) -> Boolean): ULong?
inline fun UShortArray.firstOrNull(predicate: (UShort) -> Boolean): UShort?

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

Since Kotlin

1.3
flatMap
Link copied to clipboard
inline fun <T, R> Array<out T>.flatMap(transform: (T) -> Iterable<R>): List<R>
inline fun <R> BooleanArray.flatMap(transform: (Boolean) -> Iterable<R>): List<R>
inline fun <R> ByteArray.flatMap(transform: (Byte) -> Iterable<R>): List<R>
inline fun <R> CharArray.flatMap(transform: (Char) -> Iterable<R>): List<R>
inline fun <R> DoubleArray.flatMap(transform: (Double) -> Iterable<R>): List<R>
inline fun <R> FloatArray.flatMap(transform: (Float) -> Iterable<R>): List<R>
inline fun <R> IntArray.flatMap(transform: (Int) -> Iterable<R>): List<R>
inline fun <R> LongArray.flatMap(transform: (Long) -> Iterable<R>): List<R>
inline fun <R> ShortArray.flatMap(transform: (Short) -> Iterable<R>): List<R>

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

@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.

Since Kotlin

1.4
inline fun <R> UByteArray.flatMap(transform: (UByte) -> Iterable<R>): List<R>
inline fun <R> UIntArray.flatMap(transform: (UInt) -> Iterable<R>): List<R>
inline fun <R> ULongArray.flatMap(transform: (ULong) -> Iterable<R>): List<R>
inline fun <R> UShortArray.flatMap(transform: (UShort) -> Iterable<R>): List<R>

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

Since Kotlin

1.3
inline fun <T, R> Iterable<T>.flatMap(transform: (T) -> Iterable<R>): List<R>

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

@JvmName(name = "flatMapSequence")
inline fun <T, R> Iterable<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 collection.

Since Kotlin

1.4
inline fun <K, V, R> Map<out K, V>.flatMap(transform: (Map.Entry<K, V>) -> Iterable<R>): List<R>

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

@JvmName(name = "flatMapSequence")
inline fun <K, V, R> Map<out K, V>.flatMap(transform: (Map.Entry<K, V>) -> Sequence<R>): List<R>

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

Since Kotlin

1.4
flatMapIndexed
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 <R> BooleanArray.flatMapIndexed(transform: (index: Int, Boolean) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> ByteArray.flatMapIndexed(transform: (index: Int, Byte) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> CharArray.flatMapIndexed(transform: (index: Int, Char) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> DoubleArray.flatMapIndexed(transform: (index: Int, Double) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> FloatArray.flatMapIndexed(transform: (index: Int, Float) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> IntArray.flatMapIndexed(transform: (index: Int, Int) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> LongArray.flatMapIndexed(transform: (index: Int, Long) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> ShortArray.flatMapIndexed(transform: (index: Int, Short) -> Iterable<R>): List<R>
inline fun <R> UByteArray.flatMapIndexed(transform: (index: Int, UByte) -> Iterable<R>): List<R>
inline fun <R> UIntArray.flatMapIndexed(transform: (index: Int, UInt) -> Iterable<R>): List<R>
inline fun <R> ULongArray.flatMapIndexed(transform: (index: Int, ULong) -> Iterable<R>): List<R>
inline fun <R> UShortArray.flatMapIndexed(transform: (index: Int, UShort) -> Iterable<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.

Since Kotlin

1.4
@JvmName(name = "flatMapIndexedIterable")
inline fun <T, R> Iterable<T>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedSequence")
inline fun <T, R> Iterable<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 collection.

Since Kotlin

1.4
flatMapIndexedTo
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 <R, C : MutableCollection<in R>> BooleanArray.flatMapIndexedTo(destination: C, transform: (index: Int, Boolean) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> ByteArray.flatMapIndexedTo(destination: C, transform: (index: Int, Byte) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> CharArray.flatMapIndexedTo(destination: C, transform: (index: Int, Char) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> DoubleArray.flatMapIndexedTo(destination: C, transform: (index: Int, Double) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> FloatArray.flatMapIndexedTo(destination: C, transform: (index: Int, Float) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> IntArray.flatMapIndexedTo(destination: C, transform: (index: Int, Int) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> LongArray.flatMapIndexedTo(destination: C, transform: (index: Int, Long) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> ShortArray.flatMapIndexedTo(destination: C, transform: (index: Int, Short) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> UByteArray.flatMapIndexedTo(destination: C, transform: (index: Int, UByte) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> UIntArray.flatMapIndexedTo(destination: C, transform: (index: Int, UInt) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> ULongArray.flatMapIndexedTo(destination: C, transform: (index: Int, ULong) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> UShortArray.flatMapIndexedTo(destination: C, transform: (index: Int, UShort) -> Iterable<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.

Since Kotlin

1.4
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Iterable<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 collection, to the given destination.

Since Kotlin

1.4
flatMapTo
Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(destination: C, transform: (T) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> BooleanArray.flatMapTo(destination: C, transform: (Boolean) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> ByteArray.flatMapTo(destination: C, transform: (Byte) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> CharArray.flatMapTo(destination: C, transform: (Char) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> DoubleArray.flatMapTo(destination: C, transform: (Double) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> FloatArray.flatMapTo(destination: C, transform: (Float) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> IntArray.flatMapTo(destination: C, transform: (Int) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> LongArray.flatMapTo(destination: C, transform: (Long) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> ShortArray.flatMapTo(destination: C, transform: (Short) -> Iterable<R>): C

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

@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.

Since Kotlin

1.4
inline fun <R, C : MutableCollection<in R>> UByteArray.flatMapTo(destination: C, transform: (UByte) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> UIntArray.flatMapTo(destination: C, transform: (UInt) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> ULongArray.flatMapTo(destination: C, transform: (ULong) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> UShortArray.flatMapTo(destination: C, transform: (UShort) -> Iterable<R>): C

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

Since Kotlin

1.3
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapTo(destination: C, transform: (T) -> Iterable<R>): C

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

@JvmName(name = "flatMapSequenceTo")
inline fun <T, R, C : MutableCollection<in R>> Iterable<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 collection, to the given destination.

Since Kotlin

1.4
inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(destination: C, transform: (Map.Entry<K, V>) -> Iterable<R>): C

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

@JvmName(name = "flatMapSequenceTo")
inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(destination: C, transform: (Map.Entry<K, V>) -> Sequence<R>): C

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

Since Kotlin

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

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

fun <T> Iterable<Iterable<T>>.flatten(): List<T>

Returns a single list of all elements from all collections in the given collection.

fold
Link copied to clipboard
inline fun <T, R> Array<out T>.fold(initial: R, operation: (R, T) -> R): R
inline fun <R> BooleanArray.fold(initial: R, operation: (R, Boolean) -> R): R
inline fun <R> ByteArray.fold(initial: R, operation: (R, Byte) -> R): R
inline fun <R> CharArray.fold(initial: R, operation: (R, Char) -> R): R
inline fun <R> DoubleArray.fold(initial: R, operation: (R, Double) -> R): R
inline fun <R> FloatArray.fold(initial: R, operation: (R, Float) -> R): R
inline fun <R> IntArray.fold(initial: R, operation: (R, Int) -> R): R
inline fun <R> LongArray.fold(initial: R, operation: (R, Long) -> R): R
inline fun <R> ShortArray.fold(initial: R, operation: (R, Short) -> R): R
inline fun <T, R> Iterable<T>.fold(initial: R, operation: (R, T) -> R): R

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

inline fun <R> UByteArray.fold(initial: R, operation: (R, UByte) -> R): R
inline fun <R> UIntArray.fold(initial: R, operation: (R, UInt) -> R): R
inline fun <R> ULongArray.fold(initial: R, operation: (R, ULong) -> R): R
inline fun <R> UShortArray.fold(initial: R, operation: (R, UShort) -> R): R

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

Since Kotlin

1.3
inline fun <T, K, R> Grouping<T, K>.fold(initialValue: R, operation: (R, T) -> R): Map<K, R>

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map. An initial value of accumulator is the same initialValue for each group.

Since Kotlin

1.1
inline fun <T, K, R> Grouping<T, K>.fold(initialValueSelector: (K, T) -> R, operation: (K, R, T) -> R): Map<K, R>

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map. An initial value of accumulator is provided by initialValueSelector function.

Since Kotlin

1.1
foldIndexed
Link copied to clipboard
inline fun <T, R> Array<out T>.foldIndexed(initial: R, operation: (index: Int, R, T) -> R): R
inline fun <R> BooleanArray.foldIndexed(initial: R, operation: (index: Int, R, Boolean) -> R): R
inline fun <R> ByteArray.foldIndexed(initial: R, operation: (index: Int, R, Byte) -> R): R
inline fun <R> CharArray.foldIndexed(initial: R, operation: (index: Int, R, Char) -> R): R
inline fun <R> DoubleArray.foldIndexed(initial: R, operation: (index: Int, R, Double) -> R): R
inline fun <R> FloatArray.foldIndexed(initial: R, operation: (index: Int, R, Float) -> R): R
inline fun <R> IntArray.foldIndexed(initial: R, operation: (index: Int, R, Int) -> R): R
inline fun <R> LongArray.foldIndexed(initial: R, operation: (index: Int, R, Long) -> R): R
inline fun <R> ShortArray.foldIndexed(initial: R, operation: (index: Int, R, Short) -> 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.

inline fun <R> UByteArray.foldIndexed(initial: R, operation: (index: Int, R, UByte) -> R): R
inline fun <R> UIntArray.foldIndexed(initial: R, operation: (index: Int, R, UInt) -> R): R
inline fun <R> ULongArray.foldIndexed(initial: R, operation: (index: Int, R, ULong) -> R): R
inline fun <R> UShortArray.foldIndexed(initial: R, operation: (index: Int, R, UShort) -> 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.

Since Kotlin

1.3
inline fun <T, R> Iterable<T>.foldIndexed(initial: R, operation: (index: Int, 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 collection.

foldRight
Link copied to clipboard
inline fun <T, R> Array<out T>.foldRight(initial: R, operation: (T, R) -> R): R
inline fun <R> BooleanArray.foldRight(initial: R, operation: (Boolean, R) -> R): R
inline fun <R> ByteArray.foldRight(initial: R, operation: (Byte, R) -> R): R
inline fun <R> CharArray.foldRight(initial: R, operation: (Char, R) -> R): R
inline fun <R> DoubleArray.foldRight(initial: R, operation: (Double, R) -> R): R
inline fun <R> FloatArray.foldRight(initial: R, operation: (Float, R) -> R): R
inline fun <R> IntArray.foldRight(initial: R, operation: (Int, R) -> R): R
inline fun <R> LongArray.foldRight(initial: R, operation: (Long, R) -> R): R
inline fun <R> ShortArray.foldRight(initial: R, operation: (Short, R) -> R): R
inline fun <T, R> List<T>.foldRight(initial: R, operation: (T, R) -> R): R

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

inline fun <R> UByteArray.foldRight(initial: R, operation: (UByte, R) -> R): R
inline fun <R> UIntArray.foldRight(initial: R, operation: (UInt, R) -> R): R
inline fun <R> ULongArray.foldRight(initial: R, operation: (ULong, R) -> R): R
inline fun <R> UShortArray.foldRight(initial: R, operation: (UShort, R) -> R): R

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

Since Kotlin

1.3
foldRightIndexed
Link copied to clipboard
inline fun <T, R> Array<out T>.foldRightIndexed(initial: R, operation: (index: Int, T, R) -> R): R
inline fun <R> BooleanArray.foldRightIndexed(initial: R, operation: (index: Int, Boolean, R) -> R): R
inline fun <R> ByteArray.foldRightIndexed(initial: R, operation: (index: Int, Byte, R) -> R): R
inline fun <R> CharArray.foldRightIndexed(initial: R, operation: (index: Int, Char, R) -> R): R
inline fun <R> DoubleArray.foldRightIndexed(initial: R, operation: (index: Int, Double, R) -> R): R
inline fun <R> FloatArray.foldRightIndexed(initial: R, operation: (index: Int, Float, R) -> R): R
inline fun <R> IntArray.foldRightIndexed(initial: R, operation: (index: Int, Int, R) -> R): R
inline fun <R> LongArray.foldRightIndexed(initial: R, operation: (index: Int, Long, R) -> R): R
inline fun <R> ShortArray.foldRightIndexed(initial: R, operation: (index: Int, Short, 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.

inline fun <R> UByteArray.foldRightIndexed(initial: R, operation: (index: Int, UByte, R) -> R): R
inline fun <R> UIntArray.foldRightIndexed(initial: R, operation: (index: Int, UInt, R) -> R): R
inline fun <R> ULongArray.foldRightIndexed(initial: R, operation: (index: Int, ULong, R) -> R): R
inline fun <R> UShortArray.foldRightIndexed(initial: R, operation: (index: Int, UShort, 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.

Since Kotlin

1.3
inline fun <T, R> List<T>.foldRightIndexed(initial: R, operation: (index: Int, T, 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 list and current accumulator value.

foldTo
Link copied to clipboard
inline fun <T, K, R, M : MutableMap<in K, R>> Grouping<T, K>.foldTo(destination: M, initialValue: R, operation: (R, T) -> R): M

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map. An initial value of accumulator is the same initialValue for each group.

Since Kotlin

1.1
inline fun <T, K, R, M : MutableMap<in K, R>> Grouping<T, K>.foldTo(destination: M, initialValueSelector: (K, T) -> R, operation: (K, R, T) -> R): M

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map. An initial value of accumulator is provided by initialValueSelector function.

Since Kotlin

1.1
forEach
Link copied to clipboard
inline fun <T> Array<out T>.forEach(action: (T) -> Unit)
inline fun BooleanArray.forEach(action: (Boolean) -> Unit)
inline fun ByteArray.forEach(action: (Byte) -> Unit)
inline fun CharArray.forEach(action: (Char) -> Unit)
inline fun DoubleArray.forEach(action: (Double) -> Unit)
inline fun FloatArray.forEach(action: (Float) -> Unit)
inline fun IntArray.forEach(action: (Int) -> Unit)
inline fun LongArray.forEach(action: (Long) -> Unit)
inline fun ShortArray.forEach(action: (Short) -> Unit)
inline fun <T> Iterable<T>.forEach(action: (T) -> Unit)

Performs the given action on each element.

inline fun UByteArray.forEach(action: (UByte) -> Unit)
inline fun UIntArray.forEach(action: (UInt) -> Unit)
inline fun ULongArray.forEach(action: (ULong) -> Unit)
inline fun UShortArray.forEach(action: (UShort) -> Unit)

Performs the given action on each element.

Since Kotlin

1.3
inline fun <T> Iterator<T>.forEach(operation: (T) -> Unit)

Performs the given operation on each element of this Iterator.

inline fun <K, V> Map<out K, V>.forEach(action: (Map.Entry<K, V>) -> Unit)

Performs the given action on each entry.

forEachIndexed
Link copied to clipboard
inline fun <T> Array<out T>.forEachIndexed(action: (index: Int, T) -> Unit)
inline fun BooleanArray.forEachIndexed(action: (index: Int, Boolean) -> Unit)
inline fun ByteArray.forEachIndexed(action: (index: Int, Byte) -> Unit)
inline fun CharArray.forEachIndexed(action: (index: Int, Char) -> Unit)
inline fun DoubleArray.forEachIndexed(action: (index: Int, Double) -> Unit)
inline fun FloatArray.forEachIndexed(action: (index: Int, Float) -> Unit)
inline fun IntArray.forEachIndexed(action: (index: Int, Int) -> Unit)
inline fun LongArray.forEachIndexed(action: (index: Int, Long) -> Unit)
inline fun ShortArray.forEachIndexed(action: (index: Int, Short) -> Unit)
inline fun <T> Iterable<T>.forEachIndexed(action: (index: Int, T) -> Unit)

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

inline fun UByteArray.forEachIndexed(action: (index: Int, UByte) -> Unit)
inline fun UIntArray.forEachIndexed(action: (index: Int, UInt) -> Unit)
inline fun ULongArray.forEachIndexed(action: (index: Int, ULong) -> Unit)
inline fun UShortArray.forEachIndexed(action: (index: Int, UShort) -> Unit)

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

Since Kotlin

1.3
get
Link copied to clipboard
inline operator fun <K, V> Map<out K, V>.get(key: K): V?

Returns the value corresponding to the given key, or null if such a key is not present in the map.

getOrDefault
Link copied to clipboard
inline fun <K, V> Map<out K, V>.getOrDefault(key: K, defaultValue: V): V

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

Since Kotlin

1.2
getOrElse
Link copied to clipboard
inline fun <T> Array<out T>.getOrElse(index: Int, defaultValue: (Int) -> T): T
inline fun BooleanArray.getOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean
inline fun ByteArray.getOrElse(index: Int, defaultValue: (Int) -> Byte): Byte
inline fun CharArray.getOrElse(index: Int, defaultValue: (Int) -> Char): Char
inline fun DoubleArray.getOrElse(index: Int, defaultValue: (Int) -> Double): Double
inline fun FloatArray.getOrElse(index: Int, defaultValue: (Int) -> Float): Float
inline fun IntArray.getOrElse(index: Int, defaultValue: (Int) -> Int): Int
inline fun LongArray.getOrElse(index: Int, defaultValue: (Int) -> Long): Long
inline fun ShortArray.getOrElse(index: Int, defaultValue: (Int) -> Short): Short

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.

inline fun UByteArray.getOrElse(index: Int, defaultValue: (Int) -> UByte): UByte
inline fun UIntArray.getOrElse(index: Int, defaultValue: (Int) -> UInt): UInt
inline fun ULongArray.getOrElse(index: Int, defaultValue: (Int) -> ULong): ULong
inline fun UShortArray.getOrElse(index: Int, defaultValue: (Int) -> UShort): UShort

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.

Since Kotlin

1.3
inline fun <T> List<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 list.

inline fun <K, V> Map<K, V>.getOrElse(key: K, defaultValue: () -> V): V

Returns the value for the given key, or the result of the defaultValue function if there was no entry for the given key.

getOrNull
Link copied to clipboard
fun <T> Array<out T>.getOrNull(index: Int): T?
fun BooleanArray.getOrNull(index: Int): Boolean?
fun ByteArray.getOrNull(index: Int): Byte?
fun CharArray.getOrNull(index: Int): Char?
fun DoubleArray.getOrNull(index: Int): Double?
fun FloatArray.getOrNull(index: Int): Float?
fun IntArray.getOrNull(index: Int): Int?
fun LongArray.getOrNull(index: Int): Long?
fun ShortArray.getOrNull(index: Int): Short?

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

fun UByteArray.getOrNull(index: Int): UByte?
fun UIntArray.getOrNull(index: Int): UInt?
fun ULongArray.getOrNull(index: Int): ULong?
fun UShortArray.getOrNull(index: Int): UShort?

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

Since Kotlin

1.3
fun <T> List<T>.getOrNull(index: Int): T?

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

getOrPut
Link copied to clipboard
inline fun <K, V> MutableMap<K, V>.getOrPut(key: K, defaultValue: () -> V): V

Returns the value for the given key. If the key is not found in the map, calls the defaultValue function, puts its result into the map under the given key and returns it.

inline fun <K, V> ConcurrentMap<K, V>.getOrPut(key: K, defaultValue: () -> V): V

Concurrent getOrPut, that is safe for concurrent maps.

getValue
Link copied to clipboard
fun <K, V> Map<K, V>.getValue(key: K): V

Returns the value for the given key or throws an exception if there is no such key in the map.

Since Kotlin

1.1
inline operator fun <V, V1 : V> Map<in String, V>.getValue(thisRef: Any?, property: KProperty<*>): V1

Returns the value of the property for the given object from this read-only map.

@JvmName(name = "getVar")
inline operator fun <V, V1 : V> MutableMap<in String, out V>.getValue(thisRef: Any?, property: KProperty<*>): V1

Returns the value of the property for the given object from this mutable map.

groupBy
Link copied to clipboard
inline fun <T, K> Array<out T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>
inline fun <K> BooleanArray.groupBy(keySelector: (Boolean) -> K): Map<K, List<Boolean>>
inline fun <K> ByteArray.groupBy(keySelector: (Byte) -> K): Map<K, List<Byte>>
inline fun <K> CharArray.groupBy(keySelector: (Char) -> K): Map<K, List<Char>>
inline fun <K> DoubleArray.groupBy(keySelector: (Double) -> K): Map<K, List<Double>>
inline fun <K> FloatArray.groupBy(keySelector: (Float) -> K): Map<K, List<Float>>
inline fun <K> IntArray.groupBy(keySelector: (Int) -> K): Map<K, List<Int>>
inline fun <K> LongArray.groupBy(keySelector: (Long) -> K): Map<K, List<Long>>
inline fun <K> ShortArray.groupBy(keySelector: (Short) -> K): Map<K, List<Short>>

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 <K> UByteArray.groupBy(keySelector: (UByte) -> K): Map<K, List<UByte>>
inline fun <K> UIntArray.groupBy(keySelector: (UInt) -> K): Map<K, List<UInt>>
inline fun <K> ULongArray.groupBy(keySelector: (ULong) -> K): Map<K, List<ULong>>
inline fun <K> UShortArray.groupBy(keySelector: (UShort) -> K): Map<K, List<UShort>>

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.

Since Kotlin

1.3
inline fun <T, K> Iterable<T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>

Groups elements of the original collection 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 <K, V> BooleanArray.groupBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map<K, List<V>>
inline fun <K, V> ByteArray.groupBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map<K, List<V>>
inline fun <K, V> CharArray.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, List<V>>
inline fun <K, V> DoubleArray.groupBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map<K, List<V>>
inline fun <K, V> FloatArray.groupBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map<K, List<V>>
inline fun <K, V> IntArray.groupBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map<K, List<V>>
inline fun <K, V> LongArray.groupBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map<K, List<V>>
inline fun <K, V> ShortArray.groupBy(keySelector: (Short) -> K, valueTransform: (Short) -> 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.

inline fun <K, V> UByteArray.groupBy(keySelector: (UByte) -> K, valueTransform: (UByte) -> V): Map<K, List<V>>
inline fun <K, V> UIntArray.groupBy(keySelector: (UInt) -> K, valueTransform: (UInt) -> V): Map<K, List<V>>
inline fun <K, V> ULongArray.groupBy(keySelector: (ULong) -> K, valueTransform: (ULong) -> V): Map<K, List<V>>
inline fun <K, V> UShortArray.groupBy(keySelector: (UShort) -> K, valueTransform: (UShort) -> 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.

Since Kotlin

1.3
inline fun <T, K, V> Iterable<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 collection 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.

groupByTo
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 <K, M : MutableMap<in K, MutableList<Boolean>>> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Byte>>> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharArray.groupByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Double>>> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Float>>> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Int>>> IntArray.groupByTo(destination: M, keySelector: (Int) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Long>>> LongArray.groupByTo(destination: M, keySelector: (Long) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Short>>> ShortArray.groupByTo(destination: M, keySelector: (Short) -> 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 <K, M : MutableMap<in K, MutableList<UByte>>> UByteArray.groupByTo(destination: M, keySelector: (UByte) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<UInt>>> UIntArray.groupByTo(destination: M, keySelector: (UInt) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<ULong>>> ULongArray.groupByTo(destination: M, keySelector: (ULong) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<UShort>>> UShortArray.groupByTo(destination: M, keySelector: (UShort) -> 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.

Since Kotlin

1.3
inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Iterable<T>.groupByTo(destination: M, keySelector: (T) -> K): M

Groups elements of the original collection 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 <K, V, M : MutableMap<in K, MutableList<V>>> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharArray.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> IntArray.groupByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> LongArray.groupByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> 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.

inline fun <K, V, M : MutableMap<in K, MutableList<V>>> UByteArray.groupByTo(destination: M, keySelector: (UByte) -> K, valueTransform: (UByte) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> UIntArray.groupByTo(destination: M, keySelector: (UInt) -> K, valueTransform: (UInt) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> ULongArray.groupByTo(destination: M, keySelector: (ULong) -> K, valueTransform: (ULong) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> UShortArray.groupByTo(destination: M, keySelector: (UShort) -> K, valueTransform: (UShort) -> 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.

Since Kotlin

1.3
inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Iterable<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 collection 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.

groupingBy
Link copied to clipboard
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.

Since Kotlin

1.1
inline fun <T, K> Iterable<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>

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

Since Kotlin

1.1
hashMapOf
Link copied to clipboard
inline fun <K, V> hashMapOf(): HashMap<K, V>

Returns an empty new HashMap.

Since Kotlin

1.1
fun <K, V> hashMapOf(vararg pairs: Pair<K, V>): HashMap<K, V>

Returns a new HashMap with the specified contents, given as a list of pairs where the first component is the key and the second is the value.

hashSetOf
Link copied to clipboard
inline fun <T> hashSetOf(): HashSet<T>

Returns an empty new HashSet.

Since Kotlin

1.1
fun <T> hashSetOf(vararg elements: T): HashSet<T>

Returns a new HashSet with the given elements.

ifEmpty
Link copied to clipboard
inline fun <C : Array<*>, R, R> C.ifEmpty(defaultValue: () -> R): R

Returns this array if it's not empty or the result of calling defaultValue function if the array is empty.

Since Kotlin

1.3
inline fun <C : Collection<*>, R, R> C.ifEmpty(defaultValue: () -> R): R

Returns this collection if it's not empty or the result of calling defaultValue function if the collection is empty.

Since Kotlin

1.3
inline fun <M : Map<*, *>, R, R> M.ifEmpty(defaultValue: () -> R): R

Returns this map if it's not empty or the result of calling defaultValue function if the map is empty.

Since Kotlin

1.3
indexOf
Link copied to clipboard
fun <T> Array<out T>.indexOf(element: T): Int
fun BooleanArray.indexOf(element: Boolean): Int
fun ByteArray.indexOf(element: Byte): Int
fun CharArray.indexOf(element: Char): Int
@DeprecatedSinceKotlin(warningSince = "1.4")
fun DoubleArray.indexOf(element: Double): Int
@DeprecatedSinceKotlin(warningSince = "1.4")
fun FloatArray.indexOf(element: Float): Int
fun IntArray.indexOf(element: Int): Int
fun LongArray.indexOf(element: Long): Int
fun ShortArray.indexOf(element: Short): Int

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

inline fun UByteArray.indexOf(element: UByte): Int
inline fun UIntArray.indexOf(element: UInt): Int
inline fun ULongArray.indexOf(element: ULong): Int
inline fun UShortArray.indexOf(element: UShort): Int

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

Since Kotlin

1.3
fun <T> Iterable<T>.indexOf(element: T): Int

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

fun <T> List<T>.indexOf(element: T): Int

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

indexOfFirst
Link copied to clipboard
inline fun <T> Array<out T>.indexOfFirst(predicate: (T) -> Boolean): Int
inline fun BooleanArray.indexOfFirst(predicate: (Boolean) -> Boolean): Int
inline fun ByteArray.indexOfFirst(predicate: (Byte) -> Boolean): Int
inline fun CharArray.indexOfFirst(predicate: (Char) -> Boolean): Int
inline fun DoubleArray.indexOfFirst(predicate: (Double) -> Boolean): Int
inline fun FloatArray.indexOfFirst(predicate: (Float) -> Boolean): Int
inline fun IntArray.indexOfFirst(predicate: (Int) -> Boolean): Int
inline fun LongArray.indexOfFirst(predicate: (Long) -> Boolean): Int
inline fun ShortArray.indexOfFirst(predicate: (Short) -> Boolean): Int

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

inline fun UByteArray.indexOfFirst(predicate: (UByte) -> Boolean): Int
inline fun UIntArray.indexOfFirst(predicate: (UInt) -> Boolean): Int
inline fun ULongArray.indexOfFirst(predicate: (ULong) -> Boolean): Int
inline fun UShortArray.indexOfFirst(predicate: (UShort) -> Boolean): Int

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

Since Kotlin

1.3
inline fun <T> Iterable<T>.indexOfFirst(predicate: (T) -> Boolean): Int

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

inline fun <T> List<T>.indexOfFirst(predicate: (T) -> Boolean): Int

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

indexOfLast
Link copied to clipboard
inline fun <T> Array<out T>.indexOfLast(predicate: (T) -> Boolean): Int
inline fun BooleanArray.indexOfLast(predicate: (Boolean) -> Boolean): Int
inline fun ByteArray.indexOfLast(predicate: (Byte) -> Boolean): Int
inline fun CharArray.indexOfLast(predicate: (Char) -> Boolean): Int
inline fun DoubleArray.indexOfLast(predicate: (Double) -> Boolean): Int
inline fun FloatArray.indexOfLast(predicate: (Float) -> Boolean): Int
inline fun IntArray.indexOfLast(predicate: (Int) -> Boolean): Int
inline fun LongArray.indexOfLast(predicate: (Long) -> Boolean): Int
inline fun ShortArray.indexOfLast(predicate: (Short) -> Boolean): Int

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

inline fun UByteArray.indexOfLast(predicate: (UByte) -> Boolean): Int
inline fun UIntArray.indexOfLast(predicate: (UInt) -> Boolean): Int
inline fun ULongArray.indexOfLast(predicate: (ULong) -> Boolean): Int
inline fun UShortArray.indexOfLast(predicate: (UShort) -> Boolean): Int

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

Since Kotlin

1.3
inline fun <T> Iterable<T>.indexOfLast(predicate: (T) -> Boolean): Int

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

inline fun <T> List<T>.indexOfLast(predicate: (T) -> Boolean): Int

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

intersect
Link copied to clipboard
infix fun <T> Array<out T>.intersect(other: Iterable<T>): Set<T>
infix fun BooleanArray.intersect(other: Iterable<Boolean>): Set<Boolean>
infix fun ByteArray.intersect(other: Iterable<Byte>): Set<Byte>
infix fun CharArray.intersect(other: Iterable<Char>): Set<Char>
infix fun DoubleArray.intersect(other: Iterable<Double>): Set<Double>
infix fun FloatArray.intersect(other: Iterable<Float>): Set<Float>
infix fun IntArray.intersect(other: Iterable<Int>): Set<Int>
infix fun LongArray.intersect(other: Iterable<Long>): Set<Long>
infix fun ShortArray.intersect(other: Iterable<Short>): Set<Short>

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

infix fun <T> Iterable<T>.intersect(other: Iterable<T>): Set<T>

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

isEmpty
Link copied to clipboard
inline fun <T> Array<out T>.isEmpty(): Boolean
inline fun BooleanArray.isEmpty(): Boolean
inline fun ByteArray.isEmpty(): Boolean
inline fun CharArray.isEmpty(): Boolean
inline fun DoubleArray.isEmpty(): Boolean
inline fun FloatArray.isEmpty(): Boolean
inline fun IntArray.isEmpty(): Boolean
inline fun LongArray.isEmpty(): Boolean
inline fun ShortArray.isEmpty(): Boolean

Returns true if the array is empty.

isNotEmpty
Link copied to clipboard
inline fun <T> Array<out T>.isNotEmpty(): Boolean
inline fun BooleanArray.isNotEmpty(): Boolean
inline fun ByteArray.isNotEmpty(): Boolean
inline fun CharArray.isNotEmpty(): Boolean
inline fun DoubleArray.isNotEmpty(): Boolean
inline fun FloatArray.isNotEmpty(): Boolean
inline fun IntArray.isNotEmpty(): Boolean
inline fun LongArray.isNotEmpty(): Boolean
inline fun ShortArray.isNotEmpty(): Boolean

Returns true if the array is not empty.

inline fun <T> Collection<T>.isNotEmpty(): Boolean

Returns true if the collection is not empty.

inline fun <K, V> Map<out K, V>.isNotEmpty(): Boolean

Returns true if this map is not empty.

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

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

Since Kotlin

1.3
inline fun <T> Collection<T>?.isNullOrEmpty(): Boolean

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

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>?.isNullOrEmpty(): Boolean

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

Since Kotlin

1.3
Iterable
Link copied to clipboard
inline fun <T> Iterable(crossinline iterator: () -> Iterator<T>): Iterable<T>

Given an iterator function constructs an Iterable instance that returns values through the Iterator provided by that function.

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

Returns the given iterator itself. This allows to use an instance of iterator in a for loop.

inline operator fun <K, V> Map<out K, V>.iterator(): Iterator<Map.Entry<K, V>>

Returns an Iterator over the entries in the Map.

@JvmName(name = "mutableIterator")
inline operator fun <K, V> MutableMap<K, V>.iterator(): MutableIterator<MutableMap.MutableEntry<K, V>>

Returns a MutableIterator over the mutable entries in the MutableMap.

operator fun <T> Enumeration<T>.iterator(): Iterator<T>

Creates an Iterator for an java.util.Enumeration, allowing to use it in for loops.

joinTo
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 <A : Appendable> BooleanArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Boolean) -> CharSequence? = null): A
fun <A : Appendable> ByteArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Byte) -> CharSequence? = null): A
fun <A : Appendable> CharArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Char) -> CharSequence? = null): A
fun <A : Appendable> DoubleArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Double) -> CharSequence? = null): A
fun <A : Appendable> FloatArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Float) -> CharSequence? = null): A
fun <A : Appendable> IntArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Int) -> CharSequence? = null): A
fun <A : Appendable> LongArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Long) -> CharSequence? = null): A
fun <A : Appendable> ShortArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Short) -> CharSequence? = null): A
fun <T, A : Appendable> Iterable<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.

joinToString
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 BooleanArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Boolean) -> CharSequence? = null): String
fun ByteArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Byte) -> CharSequence? = null): String
fun CharArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Char) -> CharSequence? = null): String
fun DoubleArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Double) -> CharSequence? = null): String
fun FloatArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Float) -> CharSequence? = null): String
fun IntArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Int) -> CharSequence? = null): String
fun LongArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Long) -> CharSequence? = null): String
fun ShortArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (Short) -> CharSequence? = null): String
fun <T> Iterable<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.

last
Link copied to clipboard
fun <T> Array<out T>.last(): T
fun BooleanArray.last(): Boolean
fun ByteArray.last(): Byte
fun CharArray.last(): Char
fun DoubleArray.last(): Double
fun FloatArray.last(): Float
fun IntArray.last(): Int
fun LongArray.last(): Long
fun ShortArray.last(): Short
fun <T> Iterable<T>.last(): T
fun <T> List<T>.last(): T

Returns the last element.

inline fun UByteArray.last(): UByte
inline fun UIntArray.last(): UInt
inline fun ULongArray.last(): ULong
inline fun UShortArray.last(): UShort

Returns the last element.

Since Kotlin

1.3
inline fun <T> Array<out T>.last(predicate: (T) -> Boolean): T
inline fun BooleanArray.last(predicate: (Boolean) -> Boolean): Boolean
inline fun ByteArray.last(predicate: (Byte) -> Boolean): Byte
inline fun CharArray.last(predicate: (Char) -> Boolean): Char
inline fun DoubleArray.last(predicate: (Double) -> Boolean): Double
inline fun FloatArray.last(predicate: (Float) -> Boolean): Float
inline fun IntArray.last(predicate: (Int) -> Boolean): Int
inline fun LongArray.last(predicate: (Long) -> Boolean): Long
inline fun ShortArray.last(predicate: (Short) -> Boolean): Short
inline fun <T> Iterable<T>.last(predicate: (T) -> Boolean): T
inline fun <T> List<T>.last(predicate: (T) -> Boolean): T

Returns the last element matching the given predicate.

inline fun UByteArray.last(predicate: (UByte) -> Boolean): UByte
inline fun UIntArray.last(predicate: (UInt) -> Boolean): UInt
inline fun ULongArray.last(predicate: (ULong) -> Boolean): ULong
inline fun UShortArray.last(predicate: (UShort) -> Boolean): UShort

Returns the last element matching the given predicate.

Since Kotlin

1.3
lastIndexOf
Link copied to clipboard
fun <T> Array<out T>.lastIndexOf(element: T): Int
fun BooleanArray.lastIndexOf(element: Boolean): Int
fun ByteArray.lastIndexOf(element: Byte): Int
fun CharArray.lastIndexOf(element: Char): Int
@DeprecatedSinceKotlin(warningSince = "1.4")
fun DoubleArray.lastIndexOf(element: Double): Int
@DeprecatedSinceKotlin(warningSince = "1.4")
fun FloatArray.lastIndexOf(element: Float): Int
fun IntArray.lastIndexOf(element: Int): Int
fun LongArray.lastIndexOf(element: Long): Int
fun ShortArray.lastIndexOf(element: Short): Int

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

inline fun UByteArray.lastIndexOf(element: UByte): Int
inline fun UIntArray.lastIndexOf(element: UInt): Int
inline fun ULongArray.lastIndexOf(element: ULong): Int
inline fun UShortArray.lastIndexOf(element: UShort): Int

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

Since Kotlin

1.3
fun <T> Iterable<T>.lastIndexOf(element: T): Int

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

fun <T> List<T>.lastIndexOf(element: T): Int

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

lastOrNull
Link copied to clipboard
fun <T> Array<out T>.lastOrNull(): T?
fun BooleanArray.lastOrNull(): Boolean?
fun ByteArray.lastOrNull(): Byte?
fun CharArray.lastOrNull(): Char?
fun DoubleArray.lastOrNull(): Double?
fun FloatArray.lastOrNull(): Float?
fun IntArray.lastOrNull(): Int?
fun LongArray.lastOrNull(): Long?
fun ShortArray.lastOrNull(): Short?

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

fun UByteArray.lastOrNull(): UByte?
fun UIntArray.lastOrNull(): UInt?
fun ULongArray.lastOrNull(): ULong?
fun UShortArray.lastOrNull(): UShort?

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

Since Kotlin

1.3
fun <T> Iterable<T>.lastOrNull(): T?

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

fun <T> List<T>.lastOrNull(): T?

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

inline fun <T> Array<out T>.lastOrNull(predicate: (T) -> Boolean): T?
inline fun BooleanArray.lastOrNull(predicate: (Boolean) -> Boolean): Boolean?
inline fun ByteArray.lastOrNull(predicate: (Byte) -> Boolean): Byte?
inline fun CharArray.lastOrNull(predicate: (Char) -> Boolean): Char?
inline fun DoubleArray.lastOrNull(predicate: (Double) -> Boolean): Double?
inline fun FloatArray.lastOrNull(predicate: (Float) -> Boolean): Float?
inline fun IntArray.lastOrNull(predicate: (Int) -> Boolean): Int?
inline fun LongArray.lastOrNull(predicate: (Long) -> Boolean): Long?
inline fun ShortArray.lastOrNull(predicate: (Short) -> Boolean): Short?
inline fun <T> Iterable<T>.lastOrNull(predicate: (T) -> Boolean): T?
inline fun <T> List<T>.lastOrNull(predicate: (T) -> Boolean): T?

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

inline fun UByteArray.lastOrNull(predicate: (UByte) -> Boolean): UByte?
inline fun UIntArray.lastOrNull(predicate: (UInt) -> Boolean): UInt?
inline fun ULongArray.lastOrNull(predicate: (ULong) -> Boolean): ULong?
inline fun UShortArray.lastOrNull(predicate: (UShort) -> Boolean): UShort?

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

Since Kotlin

1.3
linkedMapOf
Link copied to clipboard
inline fun <K, V> linkedMapOf(): LinkedHashMap<K, V>

Returns an empty new LinkedHashMap.

Since Kotlin

1.1
fun <K, V> linkedMapOf(vararg pairs: Pair<K, V>): LinkedHashMap<K, V>

Returns a new LinkedHashMap with the specified contents, given as a list of pairs where the first component is the key and the second is the value.

linkedSetOf
Link copied to clipboard
inline fun <T> linkedSetOf(): LinkedHashSet<T>

Returns an empty new LinkedHashSet.

Since Kotlin

1.1
fun <T> linkedSetOf(vararg elements: T): LinkedHashSet<T>

Returns a new LinkedHashSet with the given elements. Elements of the set are iterated in the order they were specified.

linkedStringMapOf
Link copied to clipboard
fun <V> linkedStringMapOf(vararg pairs: Pair<String, V>): LinkedHashMap<String, V>

Constructs the specialized implementation of LinkedHashMap with String keys, which stores the keys as properties of JS object without hashing them.

linkedStringSetOf
Link copied to clipboard
fun linkedStringSetOf(vararg elements: String): LinkedHashSet<String>

Creates a new instance of the specialized implementation of LinkedHashSet with the specified String elements, which elements the keys as properties of JS object without hashing them.

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

Creates a new read-only list with the specified size, where each element is calculated by calling the specified init function.

Since Kotlin

1.1
listOf
Link copied to clipboard
inline fun <T> listOf(): List<T>

Returns an empty read-only list. The returned list is serializable (JVM).

fun <T> listOf(vararg elements: T): List<T>

Returns a new read-only list of given elements. The returned list is serializable (JVM).

fun <T> listOf(element: T): List<T>

Returns an immutable list containing only the specified object element. The returned list is serializable.

fun <T> listOf(element: T): List<T>

Returns an immutable list containing only the specified object element.

listOfNotNull
Link copied to clipboard
fun <T : Any> listOfNotNull(element: T?): List<T>

Returns a new read-only list either of single given element, if it is not null, or empty list if the element is null. The returned list is serializable (JVM).

fun <T : Any> listOfNotNull(vararg elements: T?): List<T>

Returns a new read-only list only of those given elements, that are not null. The returned list is serializable (JVM).

map
Link copied to clipboard
inline fun <T, R> Array<out T>.map(transform: (T) -> R): List<R>
inline fun <R> BooleanArray.map(transform: (Boolean) -> R): List<R>
inline fun <R> ByteArray.map(transform: (Byte) -> R): List<R>
inline fun <R> CharArray.map(transform: (Char) -> R): List<R>
inline fun <R> DoubleArray.map(transform: (Double) -> R): List<R>
inline fun <R> FloatArray.map(transform: (Float) -> R): List<R>
inline fun <R> IntArray.map(transform: (Int) -> R): List<R>
inline fun <R> LongArray.map(transform: (Long) -> R): List<R>
inline fun <R> ShortArray.map(transform: (Short) -> R): List<R>

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

inline fun <R> UByteArray.map(transform: (UByte) -> R): List<R>
inline fun <R> UIntArray.map(transform: (UInt) -> R): List<R>
inline fun <R> ULongArray.map(transform: (ULong) -> R): List<R>
inline fun <R> UShortArray.map(transform: (UShort) -> R): List<R>

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

Since Kotlin

1.3
inline fun <T, R> Iterable<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 collection.

inline fun <K, V, R> Map<out K, V>.map(transform: (Map.Entry<K, V>) -> R): List<R>

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

mapIndexed
Link copied to clipboard
inline fun <T, R> Array<out T>.mapIndexed(transform: (index: Int, T) -> R): List<R>
inline fun <R> BooleanArray.mapIndexed(transform: (index: Int, Boolean) -> R): List<R>
inline fun <R> ByteArray.mapIndexed(transform: (index: Int, Byte) -> R): List<R>
inline fun <R> CharArray.mapIndexed(transform: (index: Int, Char) -> R): List<R>
inline fun <R> DoubleArray.mapIndexed(transform: (index: Int, Double) -> R): List<R>
inline fun <R> FloatArray.mapIndexed(transform: (index: Int, Float) -> R): List<R>
inline fun <R> IntArray.mapIndexed(transform: (index: Int, Int) -> R): List<R>
inline fun <R> LongArray.mapIndexed(transform: (index: Int, Long) -> R): List<R>
inline fun <R> ShortArray.mapIndexed(transform: (index: Int, Short) -> 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.

inline fun <R> UByteArray.mapIndexed(transform: (index: Int, UByte) -> R): List<R>
inline fun <R> UIntArray.mapIndexed(transform: (index: Int, UInt) -> R): List<R>
inline fun <R> ULongArray.mapIndexed(transform: (index: Int, ULong) -> R): List<R>
inline fun <R> UShortArray.mapIndexed(transform: (index: Int, UShort) -> 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.

Since Kotlin

1.3
inline fun <T, R> Iterable<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 collection.

mapIndexedNotNull
Link copied to clipboard
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.

inline fun <T, R : Any> Iterable<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 collection.

mapIndexedNotNullTo
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

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.

inline fun <T, R : Any, C : MutableCollection<in R>> Iterable<T>.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C

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

mapIndexedTo
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 <R, C : MutableCollection<in R>> BooleanArray.mapIndexedTo(destination: C, transform: (index: Int, Boolean) -> R): C
inline fun <R, C : MutableCollection<in R>> ByteArray.mapIndexedTo(destination: C, transform: (index: Int, Byte) -> R): C
inline fun <R, C : MutableCollection<in R>> CharArray.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C
inline fun <R, C : MutableCollection<in R>> DoubleArray.mapIndexedTo(destination: C, transform: (index: Int, Double) -> R): C
inline fun <R, C : MutableCollection<in R>> FloatArray.mapIndexedTo(destination: C, transform: (index: Int, Float) -> R): C
inline fun <R, C : MutableCollection<in R>> IntArray.mapIndexedTo(destination: C, transform: (index: Int, Int) -> R): C
inline fun <R, C : MutableCollection<in R>> LongArray.mapIndexedTo(destination: C, transform: (index: Int, Long) -> R): C
inline fun <R, C : MutableCollection<in R>> ShortArray.mapIndexedTo(destination: C, transform: (index: Int, Short) -> 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.

inline fun <R, C : MutableCollection<in R>> UByteArray.mapIndexedTo(destination: C, transform: (index: Int, UByte) -> R): C
inline fun <R, C : MutableCollection<in R>> UIntArray.mapIndexedTo(destination: C, transform: (index: Int, UInt) -> R): C
inline fun <R, C : MutableCollection<in R>> ULongArray.mapIndexedTo(destination: C, transform: (index: Int, ULong) -> R): C
inline fun <R, C : MutableCollection<in R>> UShortArray.mapIndexedTo(destination: C, transform: (index: Int, UShort) -> 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.

Since Kotlin

1.3
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C

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

mapKeys
Link copied to clipboard
inline fun <K, V, R> Map<out K, V>.mapKeys(transform: (Map.Entry<K, V>) -> R): Map<R, V>

Returns a new Map with entries having the keys obtained by applying the transform function to each entry in this Map and the values of this map.

mapKeysTo
Link copied to clipboard
inline fun <K, V, R, M : MutableMap<in R, in V>> Map<out K, V>.mapKeysTo(destination: M, transform: (Map.Entry<K, V>) -> R): M

Populates the given destination map with entries having the keys obtained by applying the transform function to each entry in this Map and the values of this map.

mapNotNull
Link copied to clipboard
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.

inline fun <T, R : Any> Iterable<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 collection.

inline fun <K, V, R : Any> Map<out K, V>.mapNotNull(transform: (Map.Entry<K, V>) -> R?): List<R>

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

mapNotNullTo
Link copied to clipboard
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.

inline fun <T, R : Any, C : MutableCollection<in R>> Iterable<T>.mapNotNullTo(destination: C, transform: (T) -> R?): C

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

inline fun <K, V, R : Any, C : MutableCollection<in R>> Map<out K, V>.mapNotNullTo(destination: C, transform: (Map.Entry<K, V>) -> R?): C

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

mapOf
Link copied to clipboard
inline fun <K, V> mapOf(): Map<K, V>

Returns an empty read-only map.

fun <K, V> mapOf(vararg pairs: Pair<K, V>): Map<K, V>

Returns a new read-only map with the specified contents, given as a list of pairs where the first value is the key and the second is the value.

fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V>

Returns an immutable map, mapping only the specified key to the specified value.

fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V>

Returns an immutable map, mapping only the specified key to the specified value.

mapTo
Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapTo(destination: C, transform: (T) -> R): C
inline fun <R, C : MutableCollection<in R>> BooleanArray.mapTo(destination: C, transform: (Boolean) -> R): C
inline fun <R, C : MutableCollection<in R>> ByteArray.mapTo(destination: C, transform: (Byte) -> R): C
inline fun <R, C : MutableCollection<in R>> CharArray.mapTo(destination: C, transform: (Char) -> R): C
inline fun <R, C : MutableCollection<in R>> DoubleArray.mapTo(destination: C, transform: (Double) -> R): C
inline fun <R, C : MutableCollection<in R>> FloatArray.mapTo(destination: C, transform: (Float) -> R): C
inline fun <R, C : MutableCollection<in R>> IntArray.mapTo(destination: C, transform: (Int) -> R): C
inline fun <R, C : MutableCollection<in R>> LongArray.mapTo(destination: C, transform: (Long) -> R): C
inline fun <R, C : MutableCollection<in R>> ShortArray.mapTo(destination: C, transform: (Short) -> R): C

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

inline fun <R, C : MutableCollection<in R>> UByteArray.mapTo(destination: C, transform: (UByte) -> R): C
inline fun <R, C : MutableCollection<in R>> UIntArray.mapTo(destination: C, transform: (UInt) -> R): C
inline fun <R, C : MutableCollection<in R>> ULongArray.mapTo(destination: C, transform: (ULong) -> R): C
inline fun <R, C : MutableCollection<in R>> UShortArray.mapTo(destination: C, transform: (UShort) -> R): C

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

Since Kotlin

1.3
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.mapTo(destination: C, transform: (T) -> R): C

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

inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.mapTo(destination: C, transform: (Map.Entry<K, V>) -> R): C

Applies the given transform function to each entry of the original map and appends the results to the given destination.

mapValues
Link copied to clipboard
inline fun <K, V, R> Map<out K, V>.mapValues(transform: (Map.Entry<K, V>) -> R): Map<K, R>

Returns a new map with entries having the keys of this map and the values obtained by applying the transform function to each entry in this Map.

mapValuesTo
Link copied to clipboard
inline fun <K, V, R, M : MutableMap<in K, in R>> Map<out K, V>.mapValuesTo(destination: M, transform: (Map.Entry<K, V>) -> R): M

Populates the given destination map with entries having the keys of this map and the values obtained by applying the transform function to each entry in this Map.

max
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T : Comparable<T>> Array<out T>.max(): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Array<out Double>.max(): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Array<out Float>.max(): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ByteArray.max(): Byte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun CharArray.max(): Char?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun DoubleArray.max(): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun FloatArray.max(): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun IntArray.max(): Int?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun LongArray.max(): Long?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ShortArray.max(): Short?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.max(): UByte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.max(): UInt?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ULongArray.max(): ULong?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UShortArray.max(): UShort?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T : Comparable<T>> Iterable<T>.max(): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Iterable<Double>.max(): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Iterable<Float>.max(): Float?
maxBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <T, R : Comparable<R>> Array<out T>.maxBy(selector: (T) -> R): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> BooleanArray.maxBy(selector: (Boolean) -> R): Boolean?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> ByteArray.maxBy(selector: (Byte) -> R): Byte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> CharArray.maxBy(selector: (Char) -> R): Char?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> DoubleArray.maxBy(selector: (Double) -> R): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> FloatArray.maxBy(selector: (Float) -> R): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> IntArray.maxBy(selector: (Int) -> R): Int?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> LongArray.maxBy(selector: (Long) -> R): Long?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> ShortArray.maxBy(selector: (Short) -> R): Short?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UByteArray.maxBy(selector: (UByte) -> R): UByte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UIntArray.maxBy(selector: (UInt) -> R): UInt?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> ULongArray.maxBy(selector: (ULong) -> R): ULong?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UShortArray.maxBy(selector: (UShort) -> R): UShort?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <T, R : Comparable<R>> Iterable<T>.maxBy(selector: (T) -> R): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?
maxByOrNull
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.maxByOrNull(selector: (T) -> R): T?
inline fun <R : Comparable<R>> BooleanArray.maxByOrNull(selector: (Boolean) -> R): Boolean?
inline fun <R : Comparable<R>> ByteArray.maxByOrNull(selector: (Byte) -> R): Byte?
inline fun <R : Comparable<R>> CharArray.maxByOrNull(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> DoubleArray.maxByOrNull(selector: (Double) -> R): Double?
inline fun <R : Comparable<R>> FloatArray.maxByOrNull(selector: (Float) -> R): Float?
inline fun <R : Comparable<R>> IntArray.maxByOrNull(selector: (Int) -> R): Int?
inline fun <R : Comparable<R>> LongArray.maxByOrNull(selector: (Long) -> R): Long?
inline fun <R : Comparable<R>> ShortArray.maxByOrNull(selector: (Short) -> R): Short?
inline fun <R : Comparable<R>> UByteArray.maxByOrNull(selector: (UByte) -> R): UByte?
inline fun <R : Comparable<R>> UIntArray.maxByOrNull(selector: (UInt) -> R): UInt?
inline fun <R : Comparable<R>> ULongArray.maxByOrNull(selector: (ULong) -> R): ULong?
inline fun <R : Comparable<R>> UShortArray.maxByOrNull(selector: (UShort) -> R): UShort?
inline fun <T, R : Comparable<R>> Iterable<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.

Since Kotlin

1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxByOrNull(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?

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

Since Kotlin

1.4
maxOf
Link copied to clipboard
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 <R : Comparable<R>> BooleanArray.maxOf(selector: (Boolean) -> R): R
inline fun BooleanArray.maxOf(selector: (Boolean) -> Double): Double
inline fun BooleanArray.maxOf(selector: (Boolean) -> Float): Float
inline fun <R : Comparable<R>> ByteArray.maxOf(selector: (Byte) -> R): R
inline fun ByteArray.maxOf(selector: (Byte) -> Double): Double
inline fun ByteArray.maxOf(selector: (Byte) -> Float): Float
inline fun <R : Comparable<R>> CharArray.maxOf(selector: (Char) -> R): R
inline fun CharArray.maxOf(selector: (Char) -> Double): Double
inline fun CharArray.maxOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> DoubleArray.maxOf(selector: (Double) -> R): R
inline fun DoubleArray.maxOf(selector: (Double) -> Double): Double
inline fun DoubleArray.maxOf(selector: (Double) -> Float): Float
inline fun <R : Comparable<R>> FloatArray.maxOf(selector: (Float) -> R): R
inline fun FloatArray.maxOf(selector: (Float) -> Double): Double
inline fun FloatArray.maxOf(selector: (Float) -> Float): Float
inline fun <R : Comparable<R>> IntArray.maxOf(selector: (Int) -> R): R
inline fun IntArray.maxOf(selector: (Int) -> Double): Double
inline fun IntArray.maxOf(selector: (Int) -> Float): Float
inline fun <R : Comparable<R>> LongArray.maxOf(selector: (Long) -> R): R
inline fun LongArray.maxOf(selector: (Long) -> Double): Double
inline fun LongArray.maxOf(selector: (Long) -> Float): Float
inline fun <R : Comparable<R>> ShortArray.maxOf(selector: (Short) -> R): R
inline fun ShortArray.maxOf(selector: (Short) -> Double): Double
inline fun ShortArray.maxOf(selector: (Short) -> Float): Float
inline fun <R : Comparable<R>> UByteArray.maxOf(selector: (UByte) -> R): R
inline fun UByteArray.maxOf(selector: (UByte) -> Double): Double
inline fun UByteArray.maxOf(selector: (UByte) -> Float): Float
inline fun <R : Comparable<R>> UIntArray.maxOf(selector: (UInt) -> R): R
inline fun UIntArray.maxOf(selector: (UInt) -> Double): Double
inline fun UIntArray.maxOf(selector: (UInt) -> Float): Float
inline fun <R : Comparable<R>> ULongArray.maxOf(selector: (ULong) -> R): R
inline fun ULongArray.maxOf(selector: (ULong) -> Double): Double
inline fun ULongArray.maxOf(selector: (ULong) -> Float): Float
inline fun <R : Comparable<R>> UShortArray.maxOf(selector: (UShort) -> R): R
inline fun UShortArray.maxOf(selector: (UShort) -> Double): Double
inline fun UShortArray.maxOf(selector: (UShort) -> Float): Float

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

Since Kotlin

1.4
inline fun <T, R : Comparable<R>> Iterable<T>.maxOf(selector: (T) -> R): R
inline fun <T> Iterable<T>.maxOf(selector: (T) -> Double): Double
inline fun <T> Iterable<T>.maxOf(selector: (T) -> Float): Float

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

Since Kotlin

1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxOf(selector: (Map.Entry<K, V>) -> R): R
inline fun <K, V> Map<out K, V>.maxOf(selector: (Map.Entry<K, V>) -> Double): Double
inline fun <K, V> Map<out K, V>.maxOf(selector: (Map.Entry<K, V>) -> Float): Float

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

Since Kotlin

1.4
maxOfOrNull
Link copied to clipboard
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 <R : Comparable<R>> BooleanArray.maxOfOrNull(selector: (Boolean) -> R): R?
inline fun BooleanArray.maxOfOrNull(selector: (Boolean) -> Double): Double?
inline fun BooleanArray.maxOfOrNull(selector: (Boolean) -> Float): Float?
inline fun <R : Comparable<R>> ByteArray.maxOfOrNull(selector: (Byte) -> R): R?
inline fun ByteArray.maxOfOrNull(selector: (Byte) -> Double): Double?
inline fun ByteArray.maxOfOrNull(selector: (Byte) -> Float): Float?
inline fun <R : Comparable<R>> CharArray.maxOfOrNull(selector: (Char) -> R): R?
inline fun CharArray.maxOfOrNull(selector: (Char) -> Double): Double?
inline fun CharArray.maxOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> DoubleArray.maxOfOrNull(selector: (Double) -> R): R?
inline fun DoubleArray.maxOfOrNull(selector: (Double) -> Double): Double?
inline fun DoubleArray.maxOfOrNull(selector: (Double) -> Float): Float?
inline fun <R : Comparable<R>> FloatArray.maxOfOrNull(selector: (Float) -> R): R?
inline fun FloatArray.maxOfOrNull(selector: (Float) -> Double): Double?
inline fun FloatArray.maxOfOrNull(selector: (Float) -> Float): Float?
inline fun <R : Comparable<R>> IntArray.maxOfOrNull(selector: (Int) -> R): R?
inline fun IntArray.maxOfOrNull(selector: (Int) -> Double): Double?
inline fun IntArray.maxOfOrNull(selector: (Int) -> Float): Float?
inline fun <R : Comparable<R>> LongArray.maxOfOrNull(selector: (Long) -> R): R?
inline fun LongArray.maxOfOrNull(selector: (Long) -> Double): Double?
inline fun LongArray.maxOfOrNull(selector: (Long) -> Float): Float?
inline fun <R : Comparable<R>> ShortArray.maxOfOrNull(selector: (Short) -> R): R?
inline fun ShortArray.maxOfOrNull(selector: (Short) -> Double): Double?
inline fun ShortArray.maxOfOrNull(selector: (Short) -> Float): Float?
inline fun <R : Comparable<R>> UByteArray.maxOfOrNull(selector: (UByte) -> R): R?
inline fun UByteArray.maxOfOrNull(selector: (UByte) -> Double): Double?
inline fun UByteArray.maxOfOrNull(selector: (UByte) -> Float): Float?
inline fun <R : Comparable<R>> UIntArray.maxOfOrNull(selector: (UInt) -> R): R?
inline fun UIntArray.maxOfOrNull(selector: (UInt) -> Double): Double?
inline fun UIntArray.maxOfOrNull(selector: (UInt) -> Float): Float?
inline fun <R : Comparable<R>> ULongArray.maxOfOrNull(selector: (ULong) -> R): R?
inline fun ULongArray.maxOfOrNull(selector: (ULong) -> Double): Double?
inline fun ULongArray.maxOfOrNull(selector: (ULong) -> Float): Float?
inline fun <R : Comparable<R>> UShortArray.maxOfOrNull(selector: (UShort) -> R): R?
inline fun UShortArray.maxOfOrNull(selector: (UShort) -> Double): Double?
inline fun UShortArray.maxOfOrNull(selector: (UShort) -> Float): Float?

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.

Since Kotlin

1.4
inline fun <T, R : Comparable<R>> Iterable<T>.maxOfOrNull(selector: (T) -> R): R?
inline fun <T> Iterable<T>.maxOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Iterable<T>.maxOfOrNull(selector: (T) -> Float): Float?

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

Since Kotlin

1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxOfOrNull(selector: (Map.Entry<K, V>) -> R): R?
inline fun <K, V> Map<out K, V>.maxOfOrNull(selector: (Map.Entry<K, V>) -> Double): Double?
inline fun <K, V> Map<out K, V>.maxOfOrNull(selector: (Map.Entry<K, V>) -> Float): Float?

Returns the largest value among all values produced by selector function applied to each entry in the map or null if there are no entries.

Since Kotlin

1.4
maxOfWith
Link copied to clipboard
inline fun <T, R> Array<out T>.maxOfWith(comparator: Comparator<in R>, selector: (T) -> R): R
inline fun <R> BooleanArray.maxOfWith(comparator: Comparator<in R>, selector: (Boolean) -> R): R
inline fun <R> ByteArray.maxOfWith(comparator: Comparator<in R>, selector: (Byte) -> R): R
inline fun <R> CharArray.maxOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R
inline fun <R> DoubleArray.maxOfWith(comparator: Comparator<in R>, selector: (Double) -> R): R
inline fun <R> FloatArray.maxOfWith(comparator: Comparator<in R>, selector: (Float) -> R): R
inline fun <R> IntArray.maxOfWith(comparator: Comparator<in R>, selector: (Int) -> R): R
inline fun <R> LongArray.maxOfWith(comparator: Comparator<in R>, selector: (Long) -> R): R
inline fun <R> ShortArray.maxOfWith(comparator: Comparator<in R>, selector: (Short) -> R): R
inline fun <R> UByteArray.maxOfWith(comparator: Comparator<in R>, selector: (UByte) -> R): R
inline fun <R> UIntArray.maxOfWith(comparator: Comparator<in R>, selector: (UInt) -> R): R
inline fun <R> ULongArray.maxOfWith(comparator: Comparator<in R>, selector: (ULong) -> R): R
inline fun <R> UShortArray.maxOfWith(comparator: Comparator<in R>, selector: (UShort) -> 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.

Since Kotlin

1.4
inline fun <T, R> Iterable<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 collection.

Since Kotlin

1.4
inline fun <K, V, R> Map<out K, V>.maxOfWith(comparator: Comparator<in R>, selector: (Map.Entry<K, V>) -> R): R

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

Since Kotlin

1.4
maxOfWithOrNull
Link copied to clipboard
inline fun <T, R> Array<out T>.maxOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?
inline fun <R> BooleanArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Boolean) -> R): R?
inline fun <R> ByteArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Byte) -> R): R?
inline fun <R> CharArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?
inline fun <R> DoubleArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Double) -> R): R?
inline fun <R> FloatArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Float) -> R): R?
inline fun <R> IntArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Int) -> R): R?
inline fun <R> LongArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Long) -> R): R?
inline fun <R> ShortArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Short) -> R): R?
inline fun <R> UByteArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (UByte) -> R): R?
inline fun <R> UIntArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (UInt) -> R): R?
inline fun <R> ULongArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (ULong) -> R): R?
inline fun <R> UShortArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (UShort) -> 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.

Since Kotlin

1.4
inline fun <T, R> Iterable<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 collection or null if there are no elements.

Since Kotlin

1.4
inline fun <K, V, R> Map<out K, V>.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Map.Entry<K, V>) -> R): R?

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

Since Kotlin

1.4
maxOrNull
Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.maxOrNull(): T?
fun Array<out Double>.maxOrNull(): Double?
fun Array<out Float>.maxOrNull(): Float?
fun ByteArray.maxOrNull(): Byte?
fun CharArray.maxOrNull(): Char?
fun DoubleArray.maxOrNull(): Double?
fun FloatArray.maxOrNull(): Float?
fun IntArray.maxOrNull(): Int?
fun LongArray.maxOrNull(): Long?
fun ShortArray.maxOrNull(): Short?
fun UByteArray.maxOrNull(): UByte?
fun UIntArray.maxOrNull(): UInt?
fun ULongArray.maxOrNull(): ULong?
fun UShortArray.maxOrNull(): UShort?
fun <T : Comparable<T>> Iterable<T>.maxOrNull(): T?
fun Iterable<Double>.maxOrNull(): Double?
fun Iterable<Float>.maxOrNull(): Float?

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

Since Kotlin

1.4
maxWith
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T> Array<out T>.maxWith(comparator: Comparator<in T>): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun BooleanArray.maxWith(comparator: Comparator<in Boolean>): Boolean?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ByteArray.maxWith(comparator: Comparator<in Byte>): Byte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun CharArray.maxWith(comparator: Comparator<in Char>): Char?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun DoubleArray.maxWith(comparator: Comparator<in Double>): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun FloatArray.maxWith(comparator: Comparator<in Float>): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun IntArray.maxWith(comparator: Comparator<in Int>): Int?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun LongArray.maxWith(comparator: Comparator<in Long>): Long?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ShortArray.maxWith(comparator: Comparator<in Short>): Short?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.maxWith(comparator: Comparator<in UByte>): UByte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.maxWith(comparator: Comparator<in UInt>): UInt?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ULongArray.maxWith(comparator: Comparator<in ULong>): ULong?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UShortArray.maxWith(comparator: Comparator<in UShort>): UShort?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T> Iterable<T>.maxWith(comparator: Comparator<in T>): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <K, V> Map<out K, V>.maxWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?
maxWithOrNull
Link copied to clipboard
fun <T> Array<out T>.maxWithOrNull(comparator: Comparator<in T>): T?
fun BooleanArray.maxWithOrNull(comparator: Comparator<in Boolean>): Boolean?
fun ByteArray.maxWithOrNull(comparator: Comparator<in Byte>): Byte?
fun CharArray.maxWithOrNull(comparator: Comparator<in Char>): Char?
fun DoubleArray.maxWithOrNull(comparator: Comparator<in Double>): Double?
fun FloatArray.maxWithOrNull(comparator: Comparator<in Float>): Float?
fun IntArray.maxWithOrNull(comparator: Comparator<in Int>): Int?
fun LongArray.maxWithOrNull(comparator: Comparator<in Long>): Long?
fun ShortArray.maxWithOrNull(comparator: Comparator<in Short>): Short?
fun UByteArray.maxWithOrNull(comparator: Comparator<in UByte>): UByte?
fun UIntArray.maxWithOrNull(comparator: Comparator<in UInt>): UInt?
fun ULongArray.maxWithOrNull(comparator: Comparator<in ULong>): ULong?
fun UShortArray.maxWithOrNull(comparator: Comparator<in UShort>): UShort?
fun <T> Iterable<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.

Since Kotlin

1.4
inline fun <K, V> Map<out K, V>.maxWithOrNull(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?

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

Since Kotlin

1.4
min
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T : Comparable<T>> Array<out T>.min(): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Array<out Double>.min(): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Array<out Float>.min(): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ByteArray.min(): Byte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun CharArray.min(): Char?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun DoubleArray.min(): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun FloatArray.min(): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun IntArray.min(): Int?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun LongArray.min(): Long?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ShortArray.min(): Short?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.min(): UByte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.min(): UInt?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ULongArray.min(): ULong?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UShortArray.min(): UShort?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T : Comparable<T>> Iterable<T>.min(): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Iterable<Double>.min(): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun Iterable<Float>.min(): Float?
minBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <T, R : Comparable<R>> Array<out T>.minBy(selector: (T) -> R): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> BooleanArray.minBy(selector: (Boolean) -> R): Boolean?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> ByteArray.minBy(selector: (Byte) -> R): Byte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> CharArray.minBy(selector: (Char) -> R): Char?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> DoubleArray.minBy(selector: (Double) -> R): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> FloatArray.minBy(selector: (Float) -> R): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> IntArray.minBy(selector: (Int) -> R): Int?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> LongArray.minBy(selector: (Long) -> R): Long?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> ShortArray.minBy(selector: (Short) -> R): Short?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UByteArray.minBy(selector: (UByte) -> R): UByte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UIntArray.minBy(selector: (UInt) -> R): UInt?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> ULongArray.minBy(selector: (ULong) -> R): ULong?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UShortArray.minBy(selector: (UShort) -> R): UShort?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <T, R : Comparable<R>> Iterable<T>.minBy(selector: (T) -> R): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <K, V, R : Comparable<R>> Map<out K, V>.minBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?
minByOrNull
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.minByOrNull(selector: (T) -> R): T?
inline fun <R : Comparable<R>> BooleanArray.minByOrNull(selector: (Boolean) -> R): Boolean?
inline fun <R : Comparable<R>> ByteArray.minByOrNull(selector: (Byte) -> R): Byte?
inline fun <R : Comparable<R>> CharArray.minByOrNull(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> DoubleArray.minByOrNull(selector: (Double) -> R): Double?
inline fun <R : Comparable<R>> FloatArray.minByOrNull(selector: (Float) -> R): Float?
inline fun <R : Comparable<R>> IntArray.minByOrNull(selector: (Int) -> R): Int?
inline fun <R : Comparable<R>> LongArray.minByOrNull(selector: (Long) -> R): Long?
inline fun <R : Comparable<R>> ShortArray.minByOrNull(selector: (Short) -> R): Short?
inline fun <R : Comparable<R>> UByteArray.minByOrNull(selector: (UByte) -> R): UByte?
inline fun <R : Comparable<R>> UIntArray.minByOrNull(selector: (UInt) -> R): UInt?
inline fun <R : Comparable<R>> ULongArray.minByOrNull(selector: (ULong) -> R): ULong?
inline fun <R : Comparable<R>> UShortArray.minByOrNull(selector: (UShort) -> R): UShort?
inline fun <T, R : Comparable<R>> Iterable<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.

Since Kotlin

1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.minByOrNull(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?

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

Since Kotlin

1.4
minOf
Link copied to clipboard
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 <R : Comparable<R>> BooleanArray.minOf(selector: (Boolean) -> R): R
inline fun BooleanArray.minOf(selector: (Boolean) -> Double): Double
inline fun BooleanArray.minOf(selector: (Boolean) -> Float): Float
inline fun <R : Comparable<R>> ByteArray.minOf(selector: (Byte) -> R): R
inline fun ByteArray.minOf(selector: (Byte) -> Double): Double
inline fun ByteArray.minOf(selector: (Byte) -> Float): Float
inline fun <R : Comparable<R>> CharArray.minOf(selector: (Char) -> R): R
inline fun CharArray.minOf(selector: (Char) -> Double): Double
inline fun CharArray.minOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> DoubleArray.minOf(selector: (Double) -> R): R
inline fun DoubleArray.minOf(selector: (Double) -> Double): Double
inline fun DoubleArray.minOf(selector: (Double) -> Float): Float
inline fun <R : Comparable<R>> FloatArray.minOf(selector: (Float) -> R): R
inline fun FloatArray.minOf(selector: (Float) -> Double): Double
inline fun FloatArray.minOf(selector: (Float) -> Float): Float
inline fun <R : Comparable<R>> IntArray.minOf(selector: (Int) -> R): R
inline fun IntArray.minOf(selector: (Int) -> Double): Double
inline fun IntArray.minOf(selector: (Int) -> Float): Float
inline fun <R : Comparable<R>> LongArray.minOf(selector: (Long) -> R): R
inline fun LongArray.minOf(selector: (Long) -> Double): Double
inline fun LongArray.minOf(selector: (Long) -> Float): Float
inline fun <R : Comparable<R>> ShortArray.minOf(selector: (Short) -> R): R
inline fun ShortArray.minOf(selector: (Short) -> Double): Double
inline fun ShortArray.minOf(selector: (Short) -> Float): Float
inline fun <R : Comparable<R>> UByteArray.minOf(selector: (UByte) -> R): R
inline fun UByteArray.minOf(selector: (UByte) -> Double): Double
inline fun UByteArray.minOf(selector: (UByte) -> Float): Float
inline fun <R : Comparable<R>> UIntArray.minOf(selector: (UInt) -> R): R
inline fun UIntArray.minOf(selector: (UInt) -> Double): Double
inline fun UIntArray.minOf(selector: (UInt) -> Float): Float
inline fun <R : Comparable<R>> ULongArray.minOf(selector: (ULong) -> R): R
inline fun ULongArray.minOf(selector: (ULong) -> Double): Double
inline fun ULongArray.minOf(selector: (ULong) -> Float): Float
inline fun <R : Comparable<R>> UShortArray.minOf(selector: (UShort) -> R): R
inline fun UShortArray.minOf(selector: (UShort) -> Double): Double
inline fun UShortArray.minOf(selector: (UShort) -> Float): Float

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

Since Kotlin

1.4
inline fun <T, R : Comparable<R>> Iterable<T>.minOf(selector: (T) -> R): R
inline fun <T> Iterable<T>.minOf(selector: (T) -> Double): Double
inline fun <T> Iterable<T>.minOf(selector: (T) -> Float): Float

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

Since Kotlin

1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.minOf(selector: (Map.Entry<K, V>) -> R): R
inline fun <K, V> Map<out K, V>.minOf(selector: (Map.Entry<K, V>) -> Double): Double
inline fun <K, V> Map<out K, V>.minOf(selector: (Map.Entry<K, V>) -> Float): Float

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

Since Kotlin

1.4
minOfOrNull
Link copied to clipboard
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 <R : Comparable<R>> BooleanArray.minOfOrNull(selector: (Boolean) -> R): R?
inline fun BooleanArray.minOfOrNull(selector: (Boolean) -> Double): Double?
inline fun BooleanArray.minOfOrNull(selector: (Boolean) -> Float): Float?
inline fun <R : Comparable<R>> ByteArray.minOfOrNull(selector: (Byte) -> R): R?
inline fun ByteArray.minOfOrNull(selector: (Byte) -> Double): Double?
inline fun ByteArray.minOfOrNull(selector: (Byte) -> Float): Float?
inline fun <R : Comparable<R>> CharArray.minOfOrNull(selector: (Char) -> R): R?
inline fun CharArray.minOfOrNull(selector: (Char) -> Double): Double?
inline fun CharArray.minOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> DoubleArray.minOfOrNull(selector: (Double) -> R): R?
inline fun DoubleArray.minOfOrNull(selector: (Double) -> Double): Double?
inline fun DoubleArray.minOfOrNull(selector: (Double) -> Float): Float?
inline fun <R : Comparable<R>> FloatArray.minOfOrNull(selector: (Float) -> R): R?
inline fun FloatArray.minOfOrNull(selector: (Float) -> Double): Double?
inline fun FloatArray.minOfOrNull(selector: (Float) -> Float): Float?
inline fun <R : Comparable<R>> IntArray.minOfOrNull(selector: (Int) -> R): R?
inline fun IntArray.minOfOrNull(selector: (Int) -> Double): Double?
inline fun IntArray.minOfOrNull(selector: (Int) -> Float): Float?
inline fun <R : Comparable<R>> LongArray.minOfOrNull(selector: (Long) -> R): R?
inline fun LongArray.minOfOrNull(selector: (Long) -> Double): Double?
inline fun LongArray.minOfOrNull(selector: (Long) -> Float): Float?
inline fun <R : Comparable<R>> ShortArray.minOfOrNull(selector: (Short) -> R): R?
inline fun ShortArray.minOfOrNull(selector: (Short) -> Double): Double?
inline fun ShortArray.minOfOrNull(selector: (Short) -> Float): Float?
inline fun <R : Comparable<R>> UByteArray.minOfOrNull(selector: (UByte) -> R): R?
inline fun UByteArray.minOfOrNull(selector: (UByte) -> Double): Double?
inline fun UByteArray.minOfOrNull(selector: (UByte) -> Float): Float?
inline fun <R : Comparable<R>> UIntArray.minOfOrNull(selector: (UInt) -> R): R?
inline fun UIntArray.minOfOrNull(selector: (UInt) -> Double): Double?
inline fun UIntArray.minOfOrNull(selector: (UInt) -> Float): Float?
inline fun <R : Comparable<R>> ULongArray.minOfOrNull(selector: (ULong) -> R): R?
inline fun ULongArray.minOfOrNull(selector: (ULong) -> Double): Double?
inline fun ULongArray.minOfOrNull(selector: (ULong) -> Float): Float?
inline fun <R : Comparable<R>> UShortArray.minOfOrNull(selector: (UShort) -> R): R?
inline fun UShortArray.minOfOrNull(selector: (UShort) -> Double): Double?
inline fun UShortArray.minOfOrNull(selector: (UShort) -> Float): Float?

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.

Since Kotlin

1.4
inline fun <T, R : Comparable<R>> Iterable<T>.minOfOrNull(selector: (T) -> R): R?
inline fun <T> Iterable<T>.minOfOrNull(selector: (T) -> Double): Double?
inline fun <T> Iterable<T>.minOfOrNull(selector: (T) -> Float): Float?

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

Since Kotlin

1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.minOfOrNull(selector: (Map.Entry<K, V>) -> R): R?
inline fun <K, V> Map<out K, V>.minOfOrNull(selector: (Map.Entry<K, V>) -> Double): Double?
inline fun <K, V> Map<out K, V>.minOfOrNull(selector: (Map.Entry<K, V>) -> Float): Float?

Returns the smallest value among all values produced by selector function applied to each entry in the map or null if there are no entries.

Since Kotlin

1.4
minOfWith
Link copied to clipboard
inline fun <T, R> Array<out T>.minOfWith(comparator: Comparator<in R>, selector: (T) -> R): R
inline fun <R> BooleanArray.minOfWith(comparator: Comparator<in R>, selector: (Boolean) -> R): R
inline fun <R> ByteArray.minOfWith(comparator: Comparator<in R>, selector: (Byte) -> R): R
inline fun <R> CharArray.minOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R
inline fun <R> DoubleArray.minOfWith(comparator: Comparator<in R>, selector: (Double) -> R): R
inline fun <R> FloatArray.minOfWith(comparator: Comparator<in R>, selector: (Float) -> R): R
inline fun <R> IntArray.minOfWith(comparator: Comparator<in R>, selector: (Int) -> R): R
inline fun <R> LongArray.minOfWith(comparator: Comparator<in R>, selector: (Long) -> R): R
inline fun <R> ShortArray.minOfWith(comparator: Comparator<in R>, selector: (Short) -> R): R
inline fun <R> UByteArray.minOfWith(comparator: Comparator<in R>, selector: (UByte) -> R): R
inline fun <R> UIntArray.minOfWith(comparator: Comparator<in R>, selector: (UInt) -> R): R
inline fun <R> ULongArray.minOfWith(comparator: Comparator<in R>, selector: (ULong) -> R): R
inline fun <R> UShortArray.minOfWith(comparator: Comparator<in R>, selector: (UShort) -> 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.

Since Kotlin

1.4
inline fun <T, R> Iterable<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 collection.

Since Kotlin

1.4
inline fun <K, V, R> Map<out K, V>.minOfWith(comparator: Comparator<in R>, selector: (Map.Entry<K, V>) -> R): R

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

Since Kotlin

1.4
minOfWithOrNull
Link copied to clipboard
inline fun <T, R> Array<out T>.minOfWithOrNull(comparator: Comparator<in R>, selector: (T) -> R): R?
inline fun <R> BooleanArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Boolean) -> R): R?
inline fun <R> ByteArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Byte) -> R): R?
inline fun <R> CharArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?
inline fun <R> DoubleArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Double) -> R): R?
inline fun <R> FloatArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Float) -> R): R?
inline fun <R> IntArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Int) -> R): R?
inline fun <R> LongArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Long) -> R): R?
inline fun <R> ShortArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Short) -> R): R?
inline fun <R> UByteArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (UByte) -> R): R?
inline fun <R> UIntArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (UInt) -> R): R?
inline fun <R> ULongArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (ULong) -> R): R?
inline fun <R> UShortArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (UShort) -> 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.

Since Kotlin

1.4
inline fun <T, R> Iterable<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 collection or null if there are no elements.

Since Kotlin

1.4
inline fun <K, V, R> Map<out K, V>.minOfWithOrNull(comparator: Comparator<in R>, selector: (Map.Entry<K, V>) -> R): R?

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

Since Kotlin

1.4
minOrNull
Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.minOrNull(): T?
fun Array<out Double>.minOrNull(): Double?
fun Array<out Float>.minOrNull(): Float?
fun ByteArray.minOrNull(): Byte?
fun CharArray.minOrNull(): Char?
fun DoubleArray.minOrNull(): Double?
fun FloatArray.minOrNull(): Float?
fun IntArray.minOrNull(): Int?
fun LongArray.minOrNull(): Long?
fun ShortArray.minOrNull(): Short?
fun UByteArray.minOrNull(): UByte?
fun UIntArray.minOrNull(): UInt?
fun ULongArray.minOrNull(): ULong?
fun UShortArray.minOrNull(): UShort?
fun <T : Comparable<T>> Iterable<T>.minOrNull(): T?
fun Iterable<Double>.minOrNull(): Double?
fun Iterable<Float>.minOrNull(): Float?

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

Since Kotlin

1.4
minus
Link copied to clipboard
operator fun <T> Iterable<T>.minus(element: T): List<T>

Returns a list containing all elements of the original collection without the first occurrence of the given element.

operator fun <T> Iterable<T>.minus(elements: Array<out T>): List<T>

Returns a list containing all elements of the original collection except the elements contained in the given elements array.

operator fun <T> Iterable<T>.minus(elements: Iterable<T>): List<T>

Returns a list containing all elements of the original collection except the elements contained in the given elements collection.

operator fun <T> Iterable<T>.minus(elements: Sequence<T>): List<T>

Returns a list containing all elements of the original collection except the elements contained in the given elements sequence.

operator fun <K, V> Map<out K, V>.minus(key: K): Map<K, V>

Returns a map containing all entries of the original map except the entry with the given key.

Since Kotlin

1.1
operator fun <K, V> Map<out K, V>.minus(keys: Array<out K>): Map<K, V>

Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys array.

Since Kotlin

1.1
operator fun <K, V> Map<out K, V>.minus(keys: Iterable<K>): Map<K, V>

Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys collection.

Since Kotlin

1.1
operator fun <K, V> Map<out K, V>.minus(keys: Sequence<K>): Map<K, V>

Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys sequence.

Since Kotlin

1.1
operator fun <T> Set<T>.minus(element: T): Set<T>

Returns a set containing all elements of the original set except the given element.

operator fun <T> Set<T>.minus(elements: Array<out T>): Set<T>

Returns a set containing all elements of the original set except the elements contained in the given elements array.

operator fun <T> Set<T>.minus(elements: Iterable<T>): Set<T>

Returns a set containing all elements of the original set except the elements contained in the given elements collection.

operator fun <T> Set<T>.minus(elements: Sequence<T>): Set<T>

Returns a set containing all elements of the original set except the elements contained in the given elements sequence.

minusAssign
Link copied to clipboard
inline operator fun <T> MutableCollection<in T>.minusAssign(element: T)

Removes a single instance of the specified element from this mutable collection.

inline operator fun <T> MutableCollection<in T>.minusAssign(elements: Array<T>)

Removes all elements contained in the given elements array from this mutable collection.

inline operator fun <T> MutableCollection<in T>.minusAssign(elements: Iterable<T>)

Removes all elements contained in the given elements collection from this mutable collection.

inline operator fun <T> MutableCollection<in T>.minusAssign(elements: Sequence<T>)

Removes all elements contained in the given elements sequence from this mutable collection.

inline operator fun <K, V> MutableMap<K, V>.minusAssign(key: K)

Removes the entry with the given key from this mutable map.

Since Kotlin

1.1
inline operator fun <K, V> MutableMap<K, V>.minusAssign(keys: Array<out K>)

Removes all entries the keys of which are contained in the given keys array from this mutable map.

Since Kotlin

1.1
inline operator fun <K, V> MutableMap<K, V>.minusAssign(keys: Iterable<K>)

Removes all entries the keys of which are contained in the given keys collection from this mutable map.

Since Kotlin

1.1
inline operator fun <K, V> MutableMap<K, V>.minusAssign(keys: Sequence<K>)

Removes all entries from the keys of which are contained in the given keys sequence from this mutable map.

Since Kotlin

1.1
minusElement
Link copied to clipboard
inline fun <T> Iterable<T>.minusElement(element: T): List<T>

Returns a list containing all elements of the original collection without the first occurrence of the given element.

inline fun <T> Set<T>.minusElement(element: T): Set<T>

Returns a set containing all elements of the original set except the given element.

minWith
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T> Array<out T>.minWith(comparator: Comparator<in T>): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun BooleanArray.minWith(comparator: Comparator<in Boolean>): Boolean?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ByteArray.minWith(comparator: Comparator<in Byte>): Byte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun CharArray.minWith(comparator: Comparator<in Char>): Char?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun DoubleArray.minWith(comparator: Comparator<in Double>): Double?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun FloatArray.minWith(comparator: Comparator<in Float>): Float?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun IntArray.minWith(comparator: Comparator<in Int>): Int?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun LongArray.minWith(comparator: Comparator<in Long>): Long?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ShortArray.minWith(comparator: Comparator<in Short>): Short?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.minWith(comparator: Comparator<in UByte>): UByte?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.minWith(comparator: Comparator<in UInt>): UInt?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun ULongArray.minWith(comparator: Comparator<in ULong>): ULong?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UShortArray.minWith(comparator: Comparator<in UShort>): UShort?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <T> Iterable<T>.minWith(comparator: Comparator<in T>): T?
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun <K, V> Map<out K, V>.minWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?
minWithOrNull
Link copied to clipboard
fun <T> Array<out T>.minWithOrNull(comparator: Comparator<in T>): T?
fun BooleanArray.minWithOrNull(comparator: Comparator<in Boolean>): Boolean?
fun ByteArray.minWithOrNull(comparator: Comparator<in Byte>): Byte?
fun CharArray.minWithOrNull(comparator: Comparator<in Char>): Char?
fun DoubleArray.minWithOrNull(comparator: Comparator<in Double>): Double?
fun FloatArray.minWithOrNull(comparator: Comparator<in Float>): Float?
fun IntArray.minWithOrNull(comparator: Comparator<in Int>): Int?
fun LongArray.minWithOrNull(comparator: Comparator<in Long>): Long?
fun ShortArray.minWithOrNull(comparator: Comparator<in Short>): Short?
fun UByteArray.minWithOrNull(comparator: Comparator<in UByte>): UByte?
fun UIntArray.minWithOrNull(comparator: Comparator<in UInt>): UInt?
fun ULongArray.minWithOrNull(comparator: Comparator<in ULong>): ULong?
fun UShortArray.minWithOrNull(comparator: Comparator<in UShort>): UShort?
fun <T> Iterable<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.

Since Kotlin

1.4
inline fun <K, V> Map<out K, V>.minWithOrNull(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?

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

Since Kotlin

1.4
MutableList
Link copied to clipboard
inline fun <T> MutableList(size: Int, init: (index: Int) -> T): MutableList<T>

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

Since Kotlin

1.1
mutableListOf
Link copied to clipboard
inline fun <T> mutableListOf(): MutableList<T>

Returns an empty new MutableList.

Since Kotlin

1.1
fun <T> mutableListOf(vararg elements: T): MutableList<T>

Returns a new MutableList with the given elements.

mutableMapOf
Link copied to clipboard
inline fun <K, V> mutableMapOf(): MutableMap<K, V>

Returns an empty new MutableMap.

Since Kotlin

1.1
fun <K, V> mutableMapOf(vararg pairs: Pair<K, V>): MutableMap<K, V>

Returns a new MutableMap with the specified contents, given as a list of pairs where the first component is the key and the second is the value.

mutableSetOf
Link copied to clipboard
inline fun <T> mutableSetOf(): MutableSet<T>

Returns an empty new MutableSet.

Since Kotlin

1.1
fun <T> mutableSetOf(vararg elements: T): MutableSet<T>

Returns a new MutableSet with the given elements. Elements of the set are iterated in the order they were specified.

none
Link copied to clipboard
fun <T> Array<out T>.none(): Boolean
fun BooleanArray.none(): Boolean
fun ByteArray.none(): Boolean
fun CharArray.none(): Boolean
fun DoubleArray.none(): Boolean
fun FloatArray.none(): Boolean
fun IntArray.none(): Boolean
fun LongArray.none(): Boolean
fun ShortArray.none(): Boolean

Returns true if the array has no elements.

inline fun UByteArray.none(): Boolean
inline fun UIntArray.none(): Boolean
inline fun ULongArray.none(): Boolean
inline fun UShortArray.none(): Boolean

Returns true if the array has no elements.

Since Kotlin

1.3
fun <T> Iterable<T>.none(): Boolean

Returns true if the collection has no elements.

fun <K, V> Map<out K, V>.none(): Boolean

Returns true if the map has no entries.

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

Returns true if no elements match the given predicate.

inline fun UByteArray.none(predicate: (UByte) -> Boolean): Boolean
inline fun UIntArray.none(predicate: (UInt) -> Boolean): Boolean
inline fun ULongArray.none(predicate: (ULong) -> Boolean): Boolean
inline fun UShortArray.none(predicate: (UShort) -> Boolean): Boolean

Returns true if no elements match the given predicate.

Since Kotlin

1.3
inline fun <K, V> Map<out K, V>.none(predicate: (Map.Entry<K, V>) -> Boolean): Boolean

Returns true if no entries match the given predicate.

onEach
Link copied to clipboard
inline fun <T, C : Iterable<T>> C.onEach(action: (T) -> Unit): C

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

Since Kotlin

1.1
inline fun <K, V, M : Map<out K, V>> M.onEach(action: (Map.Entry<K, V>) -> Unit): M

Performs the given action on each entry and returns the map itself afterwards.

Since Kotlin

1.1
inline fun <T> Array<out T>.onEach(action: (T) -> Unit): Array<out T>
inline fun BooleanArray.onEach(action: (Boolean) -> Unit): BooleanArray
inline fun ByteArray.onEach(action: (Byte) -> Unit): ByteArray
inline fun CharArray.onEach(action: (Char) -> Unit): CharArray
inline fun DoubleArray.onEach(action: (Double) -> Unit): DoubleArray
inline fun FloatArray.onEach(action: (Float) -> Unit): FloatArray
inline fun IntArray.onEach(action: (Int) -> Unit): IntArray
inline fun LongArray.onEach(action: (Long) -> Unit): LongArray
inline fun ShortArray.onEach(action: (Short) -> Unit): ShortArray
inline fun UByteArray.onEach(action: (UByte) -> Unit): UByteArray
inline fun UIntArray.onEach(action: (UInt) -> Unit): UIntArray
inline fun ULongArray.onEach(action: (ULong) -> Unit): ULongArray
inline fun UShortArray.onEach(action: (UShort) -> Unit): UShortArray

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

Since Kotlin

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

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

Since Kotlin

1.4
inline fun <K, V, M : Map<out K, V>> M.onEachIndexed(action: (index: Int, Map.Entry<K, V>) -> Unit): M

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

Since Kotlin

1.4
inline fun <T> Array<out T>.onEachIndexed(action: (index: Int, T) -> Unit): Array<out T>
inline fun BooleanArray.onEachIndexed(action: (index: Int, Boolean) -> Unit): BooleanArray
inline fun ByteArray.onEachIndexed(action: (index: Int, Byte) -> Unit): ByteArray
inline fun CharArray.onEachIndexed(action: (index: Int, Char) -> Unit): CharArray
inline fun DoubleArray.onEachIndexed(action: (index: Int, Double) -> Unit): DoubleArray
inline fun FloatArray.onEachIndexed(action: (index: Int, Float) -> Unit): FloatArray
inline fun IntArray.onEachIndexed(action: (index: Int, Int) -> Unit): IntArray
inline fun LongArray.onEachIndexed(action: (index: Int, Long) -> Unit): LongArray
inline fun ShortArray.onEachIndexed(action: (index: Int, Short) -> Unit): ShortArray
inline fun UByteArray.onEachIndexed(action: (index: Int, UByte) -> Unit): UByteArray
inline fun UIntArray.onEachIndexed(action: (index: Int, UInt) -> Unit): UIntArray
inline fun ULongArray.onEachIndexed(action: (index: Int, ULong) -> Unit): ULongArray
inline fun UShortArray.onEachIndexed(action: (index: Int, UShort) -> Unit): UShortArray

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

Since Kotlin

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

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

inline fun <T> Collection<T>?.orEmpty(): Collection<T>

Returns this Collection if it's not null and the empty list otherwise.

inline fun <T> List<T>?.orEmpty(): List<T>

Returns this List if it's not null and the empty list otherwise.

inline fun <K, V> Map<K, V>?.orEmpty(): Map<K, V>

Returns the Map if its not null, or the empty Map otherwise.

inline fun <T> Set<T>?.orEmpty(): Set<T>

Returns this Set if it's not null and the empty set otherwise.

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>

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

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

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

partition
Link copied to clipboard
inline fun <T> Array<out T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>
inline fun BooleanArray.partition(predicate: (Boolean) -> Boolean): Pair<List<Boolean>, List<Boolean>>
inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair<List<Byte>, List<Byte>>
inline fun CharArray.partition(predicate: (Char) -> Boolean): Pair<List<Char>, List<Char>>
inline fun DoubleArray.partition(predicate: (Double) -> Boolean): Pair<List<Double>, List<Double>>
inline fun FloatArray.partition(predicate: (Float) -> Boolean): Pair<List<Float>, List<Float>>
inline fun IntArray.partition(predicate: (Int) -> Boolean): Pair<List<Int>, List<Int>>
inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair<List<Long>, List<Long>>
inline fun ShortArray.partition(predicate: (Short) -> Boolean): Pair<List<Short>, List<Short>>

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.

inline fun <T> Iterable<T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>

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

plus
Link copied to clipboard
expect operator fun <T> Array<T>.plus(element: T): Array<T>
expect operator fun BooleanArray.plus(element: Boolean): BooleanArray
expect operator fun ByteArray.plus(element: Byte): ByteArray
expect operator fun CharArray.plus(element: Char): CharArray
expect operator fun DoubleArray.plus(element: Double): DoubleArray
expect operator fun FloatArray.plus(element: Float): FloatArray
expect operator fun IntArray.plus(element: Int): IntArray
expect operator fun LongArray.plus(element: Long): LongArray
expect operator fun ShortArray.plus(element: Short): ShortArray

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

expect operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
expect operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray
expect operator fun ByteArray.plus(elements: ByteArray): ByteArray
expect operator fun CharArray.plus(elements: CharArray): CharArray
expect operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray
expect operator fun FloatArray.plus(elements: FloatArray): FloatArray
expect operator fun IntArray.plus(elements: IntArray): IntArray
expect operator fun LongArray.plus(elements: LongArray): LongArray
expect operator fun ShortArray.plus(elements: ShortArray): ShortArray

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

expect operator fun <T> Array<T>.plus(elements: Collection<T>): Array<T>
expect operator fun BooleanArray.plus(elements: Collection<Boolean>): BooleanArray
expect operator fun ByteArray.plus(elements: Collection<Byte>): ByteArray
expect operator fun CharArray.plus(elements: Collection<Char>): CharArray
expect operator fun DoubleArray.plus(elements: Collection<Double>): DoubleArray
expect operator fun FloatArray.plus(elements: Collection<Float>): FloatArray
expect operator fun IntArray.plus(elements: Collection<Int>): IntArray
expect operator fun LongArray.plus(elements: Collection<Long>): LongArray
expect operator fun ShortArray.plus(elements: Collection<Short>): ShortArray

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

inline operator fun UByteArray.plus(element: UByte): UByteArray
inline operator fun UIntArray.plus(element: UInt): UIntArray
inline operator fun ULongArray.plus(element: ULong): ULongArray
inline operator fun UShortArray.plus(element: UShort): UShortArray

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

Since Kotlin

1.3
inline operator fun UByteArray.plus(elements: UByteArray): UByteArray
inline operator fun UIntArray.plus(elements: UIntArray): UIntArray
inline operator fun ULongArray.plus(elements: ULongArray): ULongArray
inline operator fun UShortArray.plus(elements: UShortArray): UShortArray

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

Since Kotlin

1.3
operator fun UByteArray.plus(elements: Collection<UByte>): UByteArray
operator fun UIntArray.plus(elements: Collection<UInt>): UIntArray
operator fun ULongArray.plus(elements: Collection<ULong>): ULongArray
operator fun UShortArray.plus(elements: Collection<UShort>): UShortArray

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

Since Kotlin

1.3
operator fun <T> Collection<T>.plus(element: T): List<T>
operator fun <T> Iterable<T>.plus(element: T): List<T>

Returns a list containing all elements of the original collection and then the given element.

operator fun <T> Collection<T>.plus(elements: Array<out T>): List<T>
operator fun <T> Iterable<T>.plus(elements: Array<out T>): List<T>

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

operator fun <T> Collection<T>.plus(elements: Iterable<T>): List<T>
operator fun <T> Iterable<T>.plus(elements: Iterable<T>): List<T>

Returns a list containing all elements of the original collection and then all elements of the given elements collection.

operator fun <T> Collection<T>.plus(elements: Sequence<T>): List<T>
operator fun <T> Iterable<T>.plus(elements: Sequence<T>): List<T>

Returns a list containing all elements of the original collection and then all elements of the given elements sequence.

operator fun <K, V> Map<out K, V>.plus(pairs: Array<out Pair<K, V>>): Map<K, V>

Creates a new read-only map by replacing or adding entries to this map from a given array of key-value pairs.

operator fun <K, V> Map<out K, V>.plus(pair: Pair<K, V>): Map<K, V>

Creates a new read-only map by replacing or adding an entry to this map from a given key-value pair.

operator fun <K, V> Map<out K, V>.plus(pairs: Iterable<Pair<K, V>>): Map<K, V>

Creates a new read-only map by replacing or adding entries to this map from a given collection of key-value pairs.

operator fun <K, V> Map<out K, V>.plus(map: Map<out K, V>): Map<K, V>

Creates a new read-only map by replacing or adding entries to this map from another map.

operator fun <K, V> Map<out K, V>.plus(pairs: Sequence<Pair<K, V>>): Map<K, V>

Creates a new read-only map by replacing or adding entries to this map from a given sequence of key-value pairs.

operator fun <T> Set<T>.plus(element: T): Set<T>

Returns a set containing all elements of the original set and then the given element if it isn't already in this set.

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

Returns a set containing all elements of the original set and the given elements array, which aren't already in this set.

operator fun <T> Set<T>.plus(elements: Iterable<T>): Set<T>

Returns a set containing all elements of the original set and the given elements collection, which aren't already in this set. The returned set preserves the element iteration order of the original set.

operator fun <T> Set<T>.plus(elements: Sequence<T>): Set<T>

Returns a set containing all elements of the original set and the given elements sequence, which aren't already in this set.

actual operator fun <T> Array<T>.plus(element: T): Array<T>
actual operator fun BooleanArray.plus(element: Boolean): BooleanArray
actual operator fun ByteArray.plus(element: Byte): ByteArray
actual operator fun CharArray.plus(element: Char): CharArray
actual operator fun DoubleArray.plus(element: Double): DoubleArray
actual operator fun FloatArray.plus(element: Float): FloatArray
actual operator fun IntArray.plus(element: Int): IntArray
actual operator fun LongArray.plus(element: Long): LongArray
actual operator fun ShortArray.plus(element: Short): ShortArray

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

actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray
actual operator fun ByteArray.plus(elements: ByteArray): ByteArray
actual operator fun CharArray.plus(elements: CharArray): CharArray
actual operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray
actual operator fun FloatArray.plus(elements: FloatArray): FloatArray
actual operator fun IntArray.plus(elements: IntArray): IntArray
actual operator fun LongArray.plus(elements: LongArray): LongArray
actual operator fun ShortArray.plus(elements: ShortArray): ShortArray

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(elements: Collection<T>): Array<T>
actual operator fun BooleanArray.plus(elements: Collection<Boolean>): BooleanArray
actual operator fun ByteArray.plus(elements: Collection<Byte>): ByteArray
actual operator fun CharArray.plus(elements: Collection<Char>): CharArray
actual operator fun DoubleArray.plus(elements: Collection<Double>): DoubleArray
actual operator fun FloatArray.plus(elements: Collection<Float>): FloatArray
actual operator fun IntArray.plus(elements: Collection<Int>): IntArray
actual operator fun LongArray.plus(elements: Collection<Long>): LongArray
actual operator fun ShortArray.plus(elements: Collection<Short>): ShortArray

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(element: T): Array<T>
actual inline operator fun BooleanArray.plus(element: Boolean): BooleanArray
actual inline operator fun ByteArray.plus(element: Byte): ByteArray
actual inline operator fun CharArray.plus(element: Char): CharArray
actual inline operator fun DoubleArray.plus(element: Double): DoubleArray
actual inline operator fun FloatArray.plus(element: Float): FloatArray
actual inline operator fun IntArray.plus(element: Int): IntArray
actual inline operator fun LongArray.plus(element: Long): LongArray
actual inline operator fun ShortArray.plus(element: Short): ShortArray

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

actual inline operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual inline operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray
actual inline operator fun ByteArray.plus(elements: ByteArray): ByteArray
actual inline operator fun CharArray.plus(elements: CharArray): CharArray
actual inline operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray
actual inline operator fun FloatArray.plus(elements: FloatArray): FloatArray
actual inline operator fun IntArray.plus(elements: IntArray): IntArray
actual inline operator fun LongArray.plus(elements: LongArray): LongArray
actual inline operator fun ShortArray.plus(elements: ShortArray): ShortArray

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(elements: Collection<T>): Array<T>
actual operator fun BooleanArray.plus(elements: Collection<Boolean>): BooleanArray
actual operator fun ByteArray.plus(elements: Collection<Byte>): ByteArray
actual operator fun CharArray.plus(elements: Collection<Char>): CharArray
actual operator fun DoubleArray.plus(elements: Collection<Double>): DoubleArray
actual operator fun FloatArray.plus(elements: Collection<Float>): FloatArray
actual operator fun IntArray.plus(elements: Collection<Int>): IntArray
actual operator fun LongArray.plus(elements: Collection<Long>): LongArray
actual operator fun ShortArray.plus(elements: Collection<Short>): ShortArray

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(element: T): Array<T>
actual operator fun BooleanArray.plus(element: Boolean): BooleanArray
actual operator fun ByteArray.plus(element: Byte): ByteArray
actual operator fun CharArray.plus(element: Char): CharArray
actual operator fun DoubleArray.plus(element: Double): DoubleArray
actual operator fun FloatArray.plus(element: Float): FloatArray
actual operator fun IntArray.plus(element: Int): IntArray
actual operator fun LongArray.plus(element: Long): LongArray
actual operator fun ShortArray.plus(element: Short): ShortArray

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

actual operator fun <T> Array<T>.plus(elements: Array<out T>): Array<T>
actual operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray
actual operator fun ByteArray.plus(elements: ByteArray): ByteArray
actual operator fun CharArray.plus(elements: CharArray): CharArray
actual operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray
actual operator fun FloatArray.plus(elements: FloatArray): FloatArray
actual operator fun IntArray.plus(elements: IntArray): IntArray
actual operator fun LongArray.plus(elements: LongArray): LongArray
actual operator fun ShortArray.plus(elements: ShortArray): ShortArray

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(elements: Collection<T>): Array<T>
actual operator fun BooleanArray.plus(elements: Collection<Boolean>): BooleanArray
actual operator fun ByteArray.plus(elements: Collection<Byte>): ByteArray
actual operator fun CharArray.plus(elements: Collection<Char>): CharArray
actual operator fun DoubleArray.plus(elements: Collection<Double>): DoubleArray
actual operator fun FloatArray.plus(elements: Collection<Float>): FloatArray
actual operator fun IntArray.plus(elements: Collection<Int>): IntArray
actual operator fun LongArray.plus(elements: Collection<Long>): LongArray
actual operator fun ShortArray.plus(elements: Collection<Short>): ShortArray

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

plusAssign
Link copied to clipboard
inline operator fun <T> MutableCollection<in T>.plusAssign(element: T)

Adds the specified element to this mutable collection.

inline operator fun <T> MutableCollection<in T>.plusAssign(elements: Array<T>)

Adds all elements of the given elements array to this mutable collection.

inline operator fun <T> MutableCollection<in T>.plusAssign(elements: Iterable<T>)

Adds all elements of the given elements collection to this mutable collection.

inline operator fun <T> MutableCollection<in T>.plusAssign(elements: Sequence<T>)

Adds all elements of the given elements sequence to this mutable collection.

inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(pairs: Array<out Pair<K, V>>)

Appends or replaces all pairs from the given array of pairs in this mutable map.

inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(pair: Pair<K, V>)

Appends or replaces the given pair in this mutable map.

inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(pairs: Iterable<Pair<K, V>>)

Appends or replaces all pairs from the given collection of pairs in this mutable map.

inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(map: Map<K, V>)

Appends or replaces all entries from the given map in this mutable map.

inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(pairs: Sequence<Pair<K, V>>)

Appends or replaces all pairs from the given sequence of pairs in this mutable map.

plusElement
Link copied to clipboard
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.

inline fun <T> Collection<T>.plusElement(element: T): List<T>
inline fun <T> Iterable<T>.plusElement(element: T): List<T>

Returns a list containing all elements of the original collection and then the given element.

inline fun <T> Set<T>.plusElement(element: T): Set<T>

Returns a set containing all elements of the original set and then the given element if it isn't already in this set.

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>

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>

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

putAll
Link copied to clipboard
fun <K, V> MutableMap<in K, in V>.putAll(pairs: Array<out Pair<K, V>>)

Puts all the given pairs into this MutableMap with the first component in the pair being the key and the second the value.

fun <K, V> MutableMap<in K, in V>.putAll(pairs: Iterable<Pair<K, V>>)

Puts all the elements of the given collection into this MutableMap with the first component in the pair being the key and the second the value.

fun <K, V> MutableMap<in K, in V>.putAll(pairs: Sequence<Pair<K, V>>)

Puts all the elements of the given sequence into this MutableMap with the first component in the pair being the key and the second the value.

random
Link copied to clipboard
inline fun <T> Array<out T>.random(): T
inline fun BooleanArray.random(): Boolean
inline fun ByteArray.random(): Byte
inline fun CharArray.random(): Char
inline fun DoubleArray.random(): Double
inline fun FloatArray.random(): Float
inline fun IntArray.random(): Int
inline fun LongArray.random(): Long
inline fun ShortArray.random(): Short
inline fun UByteArray.random(): UByte
inline fun UIntArray.random(): UInt
inline fun ULongArray.random(): ULong
inline fun UShortArray.random(): UShort

Returns a random element from this array.

Since Kotlin

1.3
inline fun <T> Collection<T>.random(): T

Returns a random element from this collection.

Since Kotlin

1.3
fun <T> Array<out T>.random(random: Random): T
fun BooleanArray.random(random: Random): Boolean
fun ByteArray.random(random: Random): Byte
fun CharArray.random(random: Random): Char
fun DoubleArray.random(random: Random): Double
fun FloatArray.random(random: Random): Float
fun IntArray.random(random: Random): Int
fun LongArray.random(random: Random): Long
fun ShortArray.random(random: Random): Short
fun UByteArray.random(random: Random): UByte
fun UIntArray.random(random: Random): UInt
fun ULongArray.random(random: Random): ULong
fun UShortArray.random(random: Random): UShort

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

Since Kotlin

1.3
fun <T> Collection<T>.random(random: Random): T

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

Since Kotlin

1.3
randomOrNull
Link copied to clipboard
inline fun <T> Array<out T>.randomOrNull(): T?
inline fun BooleanArray.randomOrNull(): Boolean?
inline fun ByteArray.randomOrNull(): Byte?
inline fun CharArray.randomOrNull(): Char?
inline fun DoubleArray.randomOrNull(): Double?
inline fun FloatArray.randomOrNull(): Float?
inline fun IntArray.randomOrNull(): Int?
inline fun LongArray.randomOrNull(): Long?
inline fun ShortArray.randomOrNull(): Short?
inline fun UByteArray.randomOrNull(): UByte?
inline fun UIntArray.randomOrNull(): UInt?
inline fun ULongArray.randomOrNull(): ULong?
inline fun UShortArray.randomOrNull(): UShort?

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

Since Kotlin

1.4
inline fun <T> Collection<T>.randomOrNull(): T?

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

Since Kotlin

1.4
fun <T> Array<out T>.randomOrNull(random: Random): T?
fun BooleanArray.randomOrNull(random: Random): Boolean?
fun ByteArray.randomOrNull(random: Random): Byte?
fun CharArray.randomOrNull(random: Random): Char?
fun DoubleArray.randomOrNull(random: Random): Double?
fun FloatArray.randomOrNull(random: Random): Float?
fun IntArray.randomOrNull(random: Random): Int?
fun LongArray.randomOrNull(random: Random): Long?
fun ShortArray.randomOrNull(random: Random): Short?
fun UByteArray.randomOrNull(random: Random): UByte?
fun UIntArray.randomOrNull(random: Random): UInt?
fun ULongArray.randomOrNull(random: Random): ULong?
fun UShortArray.randomOrNull(random: Random): UShort?

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

Since Kotlin

1.4
fun <T> Collection<T>.randomOrNull(random: Random): T?

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

Since Kotlin

1.4
reduce
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduce(operation: (S, T) -> S): S
inline fun BooleanArray.reduce(operation: (acc: Boolean, Boolean) -> Boolean): Boolean
inline fun ByteArray.reduce(operation: (acc: Byte, Byte) -> Byte): Byte
inline fun CharArray.reduce(operation: (acc: Char, Char) -> Char): Char
inline fun DoubleArray.reduce(operation: (acc: Double, Double) -> Double): Double
inline fun FloatArray.reduce(operation: (acc: Float, Float) -> Float): Float
inline fun IntArray.reduce(operation: (acc: Int, Int) -> Int): Int
inline fun LongArray.reduce(operation: (acc: Long, Long) -> Long): Long
inline fun ShortArray.reduce(operation: (acc: Short, Short) -> Short): Short
inline fun <S, T : S> Iterable<T>.reduce(operation: (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.

inline fun UByteArray.reduce(operation: (acc: UByte, UByte) -> UByte): UByte
inline fun UIntArray.reduce(operation: (acc: UInt, UInt) -> UInt): UInt
inline fun ULongArray.reduce(operation: (acc: ULong, ULong) -> ULong): ULong
inline fun UShortArray.reduce(operation: (acc: UShort, UShort) -> UShort): UShort

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

Since Kotlin

1.3
inline fun <S, T : S, K> Grouping<T, K>.reduce(operation: (K, S, T) -> S): Map<K, S>

Groups elements from the Grouping source by key and applies the reducing operation to the elements of each group sequentially starting from the second element of the group, passing the previously accumulated value and the current element as arguments, and stores the results in a new map. An initial value of accumulator is the first element of the group.

Since Kotlin

1.1
reduceIndexed
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceIndexed(operation: (index: Int, S, T) -> S): S
inline fun BooleanArray.reduceIndexed(operation: (index: Int, acc: Boolean, Boolean) -> Boolean): Boolean
inline fun ByteArray.reduceIndexed(operation: (index: Int, acc: Byte, Byte) -> Byte): Byte
inline fun CharArray.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char
inline fun DoubleArray.reduceIndexed(operation: (index: Int, acc: Double, Double) -> Double): Double
inline fun FloatArray.reduceIndexed(operation: (index: Int, acc: Float, Float) -> Float): Float
inline fun IntArray.reduceIndexed(operation: (index: Int, acc: Int, Int) -> Int): Int
inline fun LongArray.reduceIndexed(operation: (index: Int, acc: Long, Long) -> Long): Long
inline fun ShortArray.reduceIndexed(operation: (index: Int, acc: Short, Short) -> Short): Short

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.

inline fun UByteArray.reduceIndexed(operation: (index: Int, acc: UByte, UByte) -> UByte): UByte
inline fun UIntArray.reduceIndexed(operation: (index: Int, acc: UInt, UInt) -> UInt): UInt
inline fun ULongArray.reduceIndexed(operation: (index: Int, acc: ULong, ULong) -> ULong): ULong
inline fun UShortArray.reduceIndexed(operation: (index: Int, acc: UShort, UShort) -> UShort): UShort

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.

Since Kotlin

1.3
inline fun <S, T : S> Iterable<T>.reduceIndexed(operation: (index: Int, 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 collection.

reduceIndexedOrNull
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceIndexedOrNull(operation: (index: Int, S, T) -> S): S?
inline fun BooleanArray.reduceIndexedOrNull(operation: (index: Int, acc: Boolean, Boolean) -> Boolean): Boolean?
inline fun ByteArray.reduceIndexedOrNull(operation: (index: Int, acc: Byte, Byte) -> Byte): Byte?
inline fun CharArray.reduceIndexedOrNull(operation: (index: Int, acc: Char, Char) -> Char): Char?
inline fun DoubleArray.reduceIndexedOrNull(operation: (index: Int, acc: Double, Double) -> Double): Double?
inline fun FloatArray.reduceIndexedOrNull(operation: (index: Int, acc: Float, Float) -> Float): Float?
inline fun IntArray.reduceIndexedOrNull(operation: (index: Int, acc: Int, Int) -> Int): Int?
inline fun LongArray.reduceIndexedOrNull(operation: (index: Int, acc: Long, Long) -> Long): Long?
inline fun ShortArray.reduceIndexedOrNull(operation: (index: Int, acc: Short, Short) -> Short): Short?
inline fun UByteArray.reduceIndexedOrNull(operation: (index: Int, acc: UByte, UByte) -> UByte): UByte?
inline fun UIntArray.reduceIndexedOrNull(operation: (index: Int, acc: UInt, UInt) -> UInt): UInt?
inline fun ULongArray.reduceIndexedOrNull(operation: (index: Int, acc: ULong, ULong) -> ULong): ULong?
inline fun UShortArray.reduceIndexedOrNull(operation: (index: Int, acc: UShort, UShort) -> UShort): UShort?

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.

Since Kotlin

1.4
inline fun <S, T : S> Iterable<T>.reduceIndexedOrNull(operation: (index: Int, 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 collection.

Since Kotlin

1.4
reduceOrNull
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceOrNull(operation: (S, T) -> S): S?
inline fun BooleanArray.reduceOrNull(operation: (acc: Boolean, Boolean) -> Boolean): Boolean?
inline fun ByteArray.reduceOrNull(operation: (acc: Byte, Byte) -> Byte): Byte?
inline fun CharArray.reduceOrNull(operation: (acc: Char, Char) -> Char): Char?
inline fun DoubleArray.reduceOrNull(operation: (acc: Double, Double) -> Double): Double?
inline fun FloatArray.reduceOrNull(operation: (acc: Float, Float) -> Float): Float?
inline fun IntArray.reduceOrNull(operation: (acc: Int, Int) -> Int): Int?
inline fun LongArray.reduceOrNull(operation: (acc: Long, Long) -> Long): Long?
inline fun ShortArray.reduceOrNull(operation: (acc: Short, Short) -> Short): Short?
inline fun UByteArray.reduceOrNull(operation: (acc: UByte, UByte) -> UByte): UByte?
inline fun UIntArray.reduceOrNull(operation: (acc: UInt, UInt) -> UInt): UInt?
inline fun ULongArray.reduceOrNull(operation: (acc: ULong, ULong) -> ULong): ULong?
inline fun UShortArray.reduceOrNull(operation: (acc: UShort, UShort) -> UShort): UShort?
inline fun <S, T : S> Iterable<T>.reduceOrNull(operation: (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.

Since Kotlin

1.4
reduceRight
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRight(operation: (T, S) -> S): S
inline fun BooleanArray.reduceRight(operation: (Boolean, acc: Boolean) -> Boolean): Boolean
inline fun ByteArray.reduceRight(operation: (Byte, acc: Byte) -> Byte): Byte
inline fun CharArray.reduceRight(operation: (Char, acc: Char) -> Char): Char
inline fun DoubleArray.reduceRight(operation: (Double, acc: Double) -> Double): Double
inline fun FloatArray.reduceRight(operation: (Float, acc: Float) -> Float): Float
inline fun IntArray.reduceRight(operation: (Int, acc: Int) -> Int): Int
inline fun LongArray.reduceRight(operation: (Long, acc: Long) -> Long): Long
inline fun ShortArray.reduceRight(operation: (Short, acc: Short) -> Short): Short
inline fun <S, T : S> List<T>.reduceRight(operation: (T, S) -> S): S

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

inline fun UByteArray.reduceRight(operation: (UByte, acc: UByte) -> UByte): UByte
inline fun UIntArray.reduceRight(operation: (UInt, acc: UInt) -> UInt): UInt
inline fun ULongArray.reduceRight(operation: (ULong, acc: ULong) -> ULong): ULong
inline fun UShortArray.reduceRight(operation: (UShort, acc: UShort) -> UShort): UShort

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

Since Kotlin

1.3
reduceRightIndexed
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRightIndexed(operation: (index: Int, T, S) -> S): S
inline fun BooleanArray.reduceRightIndexed(operation: (index: Int, Boolean, acc: Boolean) -> Boolean): Boolean
inline fun ByteArray.reduceRightIndexed(operation: (index: Int, Byte, acc: Byte) -> Byte): Byte
inline fun CharArray.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char
inline fun DoubleArray.reduceRightIndexed(operation: (index: Int, Double, acc: Double) -> Double): Double
inline fun FloatArray.reduceRightIndexed(operation: (index: Int, Float, acc: Float) -> Float): Float
inline fun IntArray.reduceRightIndexed(operation: (index: Int, Int, acc: Int) -> Int): Int
inline fun LongArray.reduceRightIndexed(operation: (index: Int, Long, acc: Long) -> Long): Long
inline fun ShortArray.reduceRightIndexed(operation: (index: Int, Short, acc: Short) -> Short): Short

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.

inline fun UByteArray.reduceRightIndexed(operation: (index: Int, UByte, acc: UByte) -> UByte): UByte
inline fun UIntArray.reduceRightIndexed(operation: (index: Int, UInt, acc: UInt) -> UInt): UInt
inline fun ULongArray.reduceRightIndexed(operation: (index: Int, ULong, acc: ULong) -> ULong): ULong
inline fun UShortArray.reduceRightIndexed(operation: (index: Int, UShort, acc: UShort) -> UShort): UShort

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.

Since Kotlin

1.3
inline fun <S, T : S> List<T>.reduceRightIndexed(operation: (index: Int, T, 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 list and current accumulator value.

reduceRightIndexedOrNull
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRightIndexedOrNull(operation: (index: Int, T, S) -> S): S?
inline fun BooleanArray.reduceRightIndexedOrNull(operation: (index: Int, Boolean, acc: Boolean) -> Boolean): Boolean?
inline fun ByteArray.reduceRightIndexedOrNull(operation: (index: Int, Byte, acc: Byte) -> Byte): Byte?
inline fun CharArray.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char?
inline fun DoubleArray.reduceRightIndexedOrNull(operation: (index: Int, Double, acc: Double) -> Double): Double?
inline fun FloatArray.reduceRightIndexedOrNull(operation: (index: Int, Float, acc: Float) -> Float): Float?
inline fun IntArray.reduceRightIndexedOrNull(operation: (index: Int, Int, acc: Int) -> Int): Int?
inline fun LongArray.reduceRightIndexedOrNull(operation: (index: Int, Long, acc: Long) -> Long): Long?
inline fun ShortArray.reduceRightIndexedOrNull(operation: (index: Int, Short, acc: Short) -> Short): Short?
inline fun UByteArray.reduceRightIndexedOrNull(operation: (index: Int, UByte, acc: UByte) -> UByte): UByte?
inline fun UIntArray.reduceRightIndexedOrNull(operation: (index: Int, UInt, acc: UInt) -> UInt): UInt?
inline fun ULongArray.reduceRightIndexedOrNull(operation: (index: Int, ULong, acc: ULong) -> ULong): ULong?
inline fun UShortArray.reduceRightIndexedOrNull(operation: (index: Int, UShort, acc: UShort) -> UShort): UShort?

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.

Since Kotlin

1.4
inline fun <S, T : S> List<T>.reduceRightIndexedOrNull(operation: (index: Int, T, 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 list and current accumulator value.

Since Kotlin

1.4
reduceRightOrNull
Link copied to clipboard
inline fun <S, T : S> Array<out T>.reduceRightOrNull(operation: (T, S) -> S): S?
inline fun BooleanArray.reduceRightOrNull(operation: (Boolean, acc: Boolean) -> Boolean): Boolean?
inline fun ByteArray.reduceRightOrNull(operation: (Byte, acc: Byte) -> Byte): Byte?
inline fun CharArray.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char?
inline fun DoubleArray.reduceRightOrNull(operation: (Double, acc: Double) -> Double): Double?
inline fun FloatArray.reduceRightOrNull(operation: (Float, acc: Float) -> Float): Float?
inline fun IntArray.reduceRightOrNull(operation: (Int, acc: Int) -> Int): Int?
inline fun LongArray.reduceRightOrNull(operation: (Long, acc: Long) -> Long): Long?
inline fun ShortArray.reduceRightOrNull(operation: (Short, acc: Short) -> Short): Short?
inline fun UByteArray.reduceRightOrNull(operation: (UByte, acc: UByte) -> UByte): UByte?
inline fun UIntArray.reduceRightOrNull(operation: (UInt, acc: UInt) -> UInt): UInt?
inline fun ULongArray.reduceRightOrNull(operation: (ULong, acc: ULong) -> ULong): ULong?
inline fun UShortArray.reduceRightOrNull(operation: (UShort, acc: UShort) -> UShort): UShort?
inline fun <S, T : S> List<T>.reduceRightOrNull(operation: (T, S) -> S): S?

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

Since Kotlin

1.4
reduceTo
Link copied to clipboard
inline fun <S, T : S, K, M : MutableMap<in K, S>> Grouping<T, K>.reduceTo(destination: M, operation: (K, S, T) -> S): M

Groups elements from the Grouping source by key and applies the reducing operation to the elements of each group sequentially starting from the second element of the group, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map. An initial value of accumulator is the first element of the group.

Since Kotlin

1.1
remove
Link copied to clipboard
inline fun <T> MutableCollection<out T>.remove(element: T): Boolean

Removes a single instance of the specified element from this collection, if it is present.

inline fun <T> MutableList<T>.remove(index: Int): T

Removes the element at the specified index from this list. In Kotlin one should use the MutableList.removeAt function instead.

inline fun <K, V> MutableMap<out K, V>.remove(key: K): V?

Removes the specified key and its corresponding value from this map.

inline fun <K, V> MutableMap<out K, out V>.remove(key: K, value: V): Boolean

Removes the entry for the specified key only if it is currently mapped to the specified value.

Since Kotlin

1.2
removeAll
Link copied to clipboard
fun <T> MutableCollection<in T>.removeAll(elements: Array<out T>): Boolean

Removes all elements from this MutableCollection that are also contained in the given elements array.

inline fun <T> MutableCollection<out T>.removeAll(elements: Collection<T>): Boolean

Removes all of this collection's elements that are also contained in the specified collection.

fun <T> MutableCollection<in T>.removeAll(elements: Iterable<T>): Boolean

Removes all elements from this MutableCollection that are also contained in the given elements collection.

fun <T> MutableCollection<in T>.removeAll(elements: Sequence<T>): Boolean

Removes all elements from this MutableCollection that are also contained in the given elements sequence.

fun <T> MutableIterable<T>.removeAll(predicate: (T) -> Boolean): Boolean

Removes all elements from this MutableIterable that match the given predicate.

fun <T> MutableList<T>.removeAll(predicate: (T) -> Boolean): Boolean

Removes all elements from this MutableList that match the given predicate.

removeFirst
Link copied to clipboard
fun <T> MutableList<T>.removeFirst(): T

Removes the first element from this mutable list and returns that removed element, or throws NoSuchElementException if this list is empty.

Since Kotlin

1.4
removeFirstOrNull
Link copied to clipboard
fun <T> MutableList<T>.removeFirstOrNull(): T?

Removes the first element from this mutable list and returns that removed element, or returns null if this list is empty.

Since Kotlin

1.4
removeLast
Link copied to clipboard
fun <T> MutableList<T>.removeLast(): T

Removes the last element from this mutable list and returns that removed element, or throws NoSuchElementException if this list is empty.

Since Kotlin

1.4
removeLastOrNull
Link copied to clipboard
fun <T> MutableList<T>.removeLastOrNull(): T?

Removes the last element from this mutable list and returns that removed element, or returns null if this list is empty.

Since Kotlin

1.4
replaceAll
Link copied to clipboard
fun <T> MutableList<T>.replaceAll(transformation: (T) -> T)

Replaces each element in the list with a result of a transformation specified.

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

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

retainAll
Link copied to clipboard
fun <T> MutableCollection<in T>.retainAll(elements: Array<out T>): Boolean

Retains only elements of this MutableCollection that are contained in the given elements array.

inline fun <T> MutableCollection<out T>.retainAll(elements: Collection<T>): Boolean

Retains only the elements in this collection that are contained in the specified collection.

fun <T> MutableCollection<in T>.retainAll(elements: Iterable<T>): Boolean

Retains only elements of this MutableCollection that are contained in the given elements collection.

fun <T> MutableCollection<in T>.retainAll(elements: Sequence<T>): Boolean

Retains only elements of this MutableCollection that are contained in the given elements sequence.

fun <T> MutableIterable<T>.retainAll(predicate: (T) -> Boolean): Boolean

Retains only elements of this MutableIterable that match the given predicate.

fun <T> MutableList<T>.retainAll(predicate: (T) -> Boolean): Boolean

Retains only elements of this MutableList that match the given predicate.

reverse
Link copied to clipboard
fun <T> Array<T>.reverse()
fun BooleanArray.reverse()
fun ByteArray.reverse()
fun CharArray.reverse()
fun DoubleArray.reverse()
fun FloatArray.reverse()
fun IntArray.reverse()
fun LongArray.reverse()
fun ShortArray.reverse()

Reverses elements in the array in-place.

inline fun UByteArray.reverse()
inline fun UIntArray.reverse()
inline fun ULongArray.reverse()
inline fun UShortArray.reverse()

Reverses elements in the array in-place.

Since Kotlin

1.3
expect fun <T> MutableList<T>.reverse()

Reverses elements in the list in-place.

fun <T> Array<T>.reverse(fromIndex: Int, toIndex: Int)
fun BooleanArray.reverse(fromIndex: Int, toIndex: Int)
fun ByteArray.reverse(fromIndex: Int, toIndex: Int)
fun CharArray.reverse(fromIndex: Int, toIndex: Int)
fun DoubleArray.reverse(fromIndex: Int, toIndex: Int)
fun FloatArray.reverse(fromIndex: Int, toIndex: Int)
fun IntArray.reverse(fromIndex: Int, toIndex: Int)
fun LongArray.reverse(fromIndex: Int, toIndex: Int)
fun ShortArray.reverse(fromIndex: Int, toIndex: Int)
inline fun UByteArray.reverse(fromIndex: Int, toIndex: Int)
inline fun UIntArray.reverse(fromIndex: Int, toIndex: Int)
inline fun ULongArray.reverse(fromIndex: Int, toIndex: Int)
inline fun UShortArray.reverse(fromIndex: Int, toIndex: Int)

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

Since Kotlin

1.4
actual fun <T> MutableList<T>.reverse()

Reverses elements in the list in-place.

actual fun <T> MutableList<T>.reverse()

Reverses elements in the list in-place.

actual fun <T> MutableList<T>.reverse()

Reverses elements in the list in-place.

reversed
Link copied to clipboard
fun <T> Array<out T>.reversed(): List<T>
fun BooleanArray.reversed(): List<Boolean>
fun ByteArray.reversed(): List<Byte>
fun CharArray.reversed(): List<Char>
fun DoubleArray.reversed(): List<Double>
fun FloatArray.reversed(): List<Float>
fun IntArray.reversed(): List<Int>
fun LongArray.reversed(): List<Long>
fun ShortArray.reversed(): List<Short>
fun <T> Iterable<T>.reversed(): List<T>

Returns a list with elements in reversed order.

fun UByteArray.reversed(): List<UByte>
fun UIntArray.reversed(): List<UInt>
fun ULongArray.reversed(): List<ULong>
fun UShortArray.reversed(): List<UShort>

Returns a list with elements in reversed order.

Since Kotlin

1.3
reversedArray
Link copied to clipboard
fun <T> Array<T>.reversedArray(): Array<T>
fun BooleanArray.reversedArray(): BooleanArray
fun ByteArray.reversedArray(): ByteArray
fun CharArray.reversedArray(): CharArray
fun DoubleArray.reversedArray(): DoubleArray
fun FloatArray.reversedArray(): FloatArray
fun IntArray.reversedArray(): IntArray
fun LongArray.reversedArray(): LongArray
fun ShortArray.reversedArray(): ShortArray

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

inline fun UByteArray.reversedArray(): UByteArray
inline fun UIntArray.reversedArray(): UIntArray
inline fun ULongArray.reversedArray(): ULongArray
inline fun UShortArray.reversedArray(): UShortArray

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

Since Kotlin

1.3
runningFold
Link copied to clipboard
inline fun <T, R> Array<out T>.runningFold(initial: R, operation: (R, T) -> R): List<R>
inline fun <R> BooleanArray.runningFold(initial: R, operation: (R, Boolean) -> R): List<R>
inline fun <R> ByteArray.runningFold(initial: R, operation: (R, Byte) -> R): List<R>
inline fun <R> CharArray.runningFold(initial: R, operation: (R, Char) -> R): List<R>
inline fun <R> DoubleArray.runningFold(initial: R, operation: (R, Double) -> R): List<R>
inline fun <R> FloatArray.runningFold(initial: R, operation: (R, Float) -> R): List<R>
inline fun <R> IntArray.runningFold(initial: R, operation: (R, Int) -> R): List<R>
inline fun <R> LongArray.runningFold(initial: R, operation: (R, Long) -> R): List<R>
inline fun <R> ShortArray.runningFold(initial: R, operation: (R, Short) -> R): List<R>
inline fun <R> UByteArray.runningFold(initial: R, operation: (R, UByte) -> R): List<R>
inline fun <R> UIntArray.runningFold(initial: R, operation: (R, UInt) -> R): List<R>
inline fun <R> ULongArray.runningFold(initial: R, operation: (R, ULong) -> R): List<R>
inline fun <R> UShortArray.runningFold(initial: R, operation: (R, UShort) -> R): List<R>
inline fun <T, R> Iterable<T>.runningFold(initial: R, operation: (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.

Since Kotlin

1.4
runningFoldIndexed
Link copied to clipboard
inline fun <T, R> Array<out T>.runningFoldIndexed(initial: R, operation: (index: Int, R, T) -> R): List<R>
inline fun <R> BooleanArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Boolean) -> R): List<R>
inline fun <R> ByteArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Byte) -> R): List<R>
inline fun <R> CharArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Char) -> R): List<R>
inline fun <R> DoubleArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Double) -> R): List<R>
inline fun <R> FloatArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Float) -> R): List<R>
inline fun <R> IntArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Int) -> R): List<R>
inline fun <R> LongArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Long) -> R): List<R>
inline fun <R> ShortArray.runningFoldIndexed(initial: R, operation: (index: Int, R, Short) -> R): List<R>
inline fun <R> UByteArray.runningFoldIndexed(initial: R, operation: (index: Int, R, UByte) -> R): List<R>
inline fun <R> UIntArray.runningFoldIndexed(initial: R, operation: (index: Int, R, UInt) -> R): List<R>
inline fun <R> ULongArray.runningFoldIndexed(initial: R, operation: (index: Int, R, ULong) -> R): List<R>
inline fun <R> UShortArray.runningFoldIndexed(initial: R, operation: (index: Int, R, UShort) -> 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.

Since Kotlin

1.4
inline fun <T, R> Iterable<T>.runningFoldIndexed(initial: R, operation: (index: Int, 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 collection and current accumulator value that starts with initial value.

Since Kotlin

1.4
runningReduce
Link copied to clipboard
inline fun <S, T : S> Array<out T>.runningReduce(operation: (S, T) -> S): List<S>
inline fun BooleanArray.runningReduce(operation: (acc: Boolean, Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.runningReduce(operation: (acc: Byte, Byte) -> Byte): List<Byte>
inline fun CharArray.runningReduce(operation: (acc: Char, Char) -> Char): List<Char>
inline fun DoubleArray.runningReduce(operation: (acc: Double, Double) -> Double): List<Double>
inline fun FloatArray.runningReduce(operation: (acc: Float, Float) -> Float): List<Float>
inline fun IntArray.runningReduce(operation: (acc: Int, Int) -> Int): List<Int>
inline fun LongArray.runningReduce(operation: (acc: Long, Long) -> Long): List<Long>
inline fun ShortArray.runningReduce(operation: (acc: Short, Short) -> Short): List<Short>
inline fun UByteArray.runningReduce(operation: (acc: UByte, UByte) -> UByte): List<UByte>
inline fun UIntArray.runningReduce(operation: (acc: UInt, UInt) -> UInt): List<UInt>
inline fun ULongArray.runningReduce(operation: (acc: ULong, ULong) -> ULong): List<ULong>
inline fun UShortArray.runningReduce(operation: (acc: UShort, UShort) -> UShort): List<UShort>

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.

Since Kotlin

1.4
inline fun <S, T : S> Iterable<T>.runningReduce(operation: (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 collection.

Since Kotlin

1.4
runningReduceIndexed
Link copied to clipboard
inline fun <S, T : S> Array<out T>.runningReduceIndexed(operation: (index: Int, S, T) -> S): List<S>
inline fun BooleanArray.runningReduceIndexed(operation: (index: Int, acc: Boolean, Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.runningReduceIndexed(operation: (index: Int, acc: Byte, Byte) -> Byte): List<Byte>
inline fun CharArray.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List<Char>
inline fun DoubleArray.runningReduceIndexed(operation: (index: Int, acc: Double, Double) -> Double): List<Double>
inline fun FloatArray.runningReduceIndexed(operation: (index: Int, acc: Float, Float) -> Float): List<Float>
inline fun IntArray.runningReduceIndexed(operation: (index: Int, acc: Int, Int) -> Int): List<Int>
inline fun LongArray.runningReduceIndexed(operation: (index: Int, acc: Long, Long) -> Long): List<Long>
inline fun ShortArray.runningReduceIndexed(operation: (index: Int, acc: Short, Short) -> Short): List<Short>
inline fun UByteArray.runningReduceIndexed(operation: (index: Int, acc: UByte, UByte) -> UByte): List<UByte>
inline fun UIntArray.runningReduceIndexed(operation: (index: Int, acc: UInt, UInt) -> UInt): List<UInt>
inline fun ULongArray.runningReduceIndexed(operation: (index: Int, acc: ULong, ULong) -> ULong): List<ULong>
inline fun UShortArray.runningReduceIndexed(operation: (index: Int, acc: UShort, UShort) -> UShort): List<UShort>

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.

Since Kotlin

1.4
inline fun <S, T : S> Iterable<T>.runningReduceIndexed(operation: (index: Int, 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 collection and current accumulator value that starts with the first element of this collection.

Since Kotlin

1.4
scan
Link copied to clipboard
inline fun <T, R> Array<out T>.scan(initial: R, operation: (R, T) -> R): List<R>
inline fun <R> BooleanArray.scan(initial: R, operation: (R, Boolean) -> R): List<R>
inline fun <R> ByteArray.scan(initial: R, operation: (R, Byte) -> R): List<R>
inline fun <R> CharArray.scan(initial: R, operation: (R, Char) -> R): List<R>
inline fun <R> DoubleArray.scan(initial: R, operation: (R, Double) -> R): List<R>
inline fun <R> FloatArray.scan(initial: R, operation: (R, Float) -> R): List<R>
inline fun <R> IntArray.scan(initial: R, operation: (R, Int) -> R): List<R>
inline fun <R> LongArray.scan(initial: R, operation: (R, Long) -> R): List<R>
inline fun <R> ShortArray.scan(initial: R, operation: (R, Short) -> R): List<R>
inline fun <R> UByteArray.scan(initial: R, operation: (R, UByte) -> R): List<R>
inline fun <R> UIntArray.scan(initial: R, operation: (R, UInt) -> R): List<R>
inline fun <R> ULongArray.scan(initial: R, operation: (R, ULong) -> R): List<R>
inline fun <R> UShortArray.scan(initial: R, operation: (R, UShort) -> R): List<R>
inline fun <T, R> Iterable<T>.scan(initial: R, operation: (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.

Since Kotlin

1.4
scanIndexed
Link copied to clipboard
inline fun <T, R> Array<out T>.scanIndexed(initial: R, operation: (index: Int, R, T) -> R): List<R>
inline fun <R> BooleanArray.scanIndexed(initial: R, operation: (index: Int, R, Boolean) -> R): List<R>
inline fun <R> ByteArray.scanIndexed(initial: R, operation: (index: Int, R, Byte) -> R): List<R>
inline fun <R> CharArray.scanIndexed(initial: R, operation: (index: Int, R, Char) -> R): List<R>
inline fun <R> DoubleArray.scanIndexed(initial: R, operation: (index: Int, R, Double) -> R): List<R>
inline fun <R> FloatArray.scanIndexed(initial: R, operation: (index: Int, R, Float) -> R): List<R>
inline fun <R> IntArray.scanIndexed(initial: R, operation: (index: Int, R, Int) -> R): List<R>
inline fun <R> LongArray.scanIndexed(initial: R, operation: (index: Int, R, Long) -> R): List<R>
inline fun <R> ShortArray.scanIndexed(initial: R, operation: (index: Int, R, Short) -> R): List<R>
inline fun <R> UByteArray.scanIndexed(initial: R, operation: (index: Int, R, UByte) -> R): List<R>
inline fun <R> UIntArray.scanIndexed(initial: R, operation: (index: Int, R, UInt) -> R): List<R>
inline fun <R> ULongArray.scanIndexed(initial: R, operation: (index: Int, R, ULong) -> R): List<R>
inline fun <R> UShortArray.scanIndexed(initial: R, operation: (index: Int, R, UShort) -> 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.

Since Kotlin

1.4
inline fun <T, R> Iterable<T>.scanIndexed(initial: R, operation: (index: Int, 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 collection and current accumulator value that starts with initial value.

Since Kotlin

1.4
set
Link copied to clipboard
inline operator fun <K, V> MutableMap<K, V>.set(key: K, value: V)

Allows to use the index operator for storing values in a mutable map.

setOf
Link copied to clipboard
inline fun <T> setOf(): Set<T>

Returns an empty read-only set. The returned set is serializable (JVM).

fun <T> setOf(vararg elements: T): Set<T>

Returns a new read-only set with the given elements. Elements of the set are iterated in the order they were specified. The returned set is serializable (JVM).

fun <T> setOf(element: T): Set<T>

Returns an immutable set containing only the specified object element. The returned set is serializable.

fun <T> setOf(element: T): Set<T>

Returns an immutable set containing only the specified object element.

fun <T> setOf(element: T): Set<T>

Returns an immutable set containing only the specified object element.

setOfNotNull
Link copied to clipboard
fun <T : Any> setOfNotNull(element: T?): Set<T>

Returns a new read-only set either with single given element, if it is not null, or empty set if the element is null. The returned set is serializable (JVM).

Since Kotlin

1.4
fun <T : Any> setOfNotNull(vararg elements: T?): Set<T>

Returns a new read-only set only with those given elements, that are not null. Elements of the set are iterated in the order they were specified. The returned set is serializable (JVM).

Since Kotlin

1.4
setValue
Link copied to clipboard
inline operator fun <V> MutableMap<in String, in V>.setValue(thisRef: Any?, property: KProperty<*>, value: V)

Stores the value of the property for the given object in this mutable map.

shuffle
Link copied to clipboard
fun <T> Array<T>.shuffle()
fun BooleanArray.shuffle()
fun ByteArray.shuffle()
fun CharArray.shuffle()
fun DoubleArray.shuffle()
fun FloatArray.shuffle()
fun IntArray.shuffle()
fun LongArray.shuffle()
fun ShortArray.shuffle()
fun UByteArray.shuffle()
fun UIntArray.shuffle()
fun ULongArray.shuffle()
fun UShortArray.shuffle()

Randomly shuffles elements in this array in-place.

Since Kotlin

1.4
expect fun <T> MutableList<T>.shuffle()
fun <T> Array<T>.shuffle(random: Random)
fun BooleanArray.shuffle(random: Random)
fun ByteArray.shuffle(random: Random)
fun CharArray.shuffle(random: Random)
fun DoubleArray.shuffle(random: Random)
fun FloatArray.shuffle(random: Random)
fun IntArray.shuffle(random: Random)
fun LongArray.shuffle(random: Random)
fun ShortArray.shuffle(random: Random)
fun UByteArray.shuffle(random: Random)
fun UIntArray.shuffle(random: Random)
fun ULongArray.shuffle(random: Random)
fun UShortArray.shuffle(random: Random)

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

Since Kotlin

1.4
fun <T> MutableList<T>.shuffle(random: Random)

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

Since Kotlin

1.3
actual inline fun <T> MutableList<T>.shuffle()

Randomly shuffles elements in this mutable list.

Since Kotlin

1.2
inline fun <T> MutableList<T>.shuffle(random: Random)

Randomly shuffles elements in this mutable list using the specified random instance as the source of randomness.

Since Kotlin

1.2
actual fun <T> MutableList<T>.shuffle()

Randomly shuffles elements in this list.

Since Kotlin

1.2
actual fun <T> MutableList<T>.shuffle()

Randomly shuffles elements in this list.

Since Kotlin

1.2
shuffled
Link copied to clipboard
expect fun <T> Iterable<T>.shuffled(): List<T>
fun <T> Iterable<T>.shuffled(random: Random): List<T>

Returns a new list with the elements of this list randomly shuffled using the specified random instance as the source of randomness.

Since Kotlin

1.3
actual fun <T> Iterable<T>.shuffled(): List<T>

Returns a new list with the elements of this list randomly shuffled.

Since Kotlin

1.2
fun <T> Iterable<T>.shuffled(random: Random): List<T>

Returns a new list with the elements of this list randomly shuffled using the specified random instance as the source of randomness.

Since Kotlin

1.2
actual fun <T> Iterable<T>.shuffled(): List<T>

Returns a new list with the elements of this list randomly shuffled.

Since Kotlin

1.2
actual fun <T> Iterable<T>.shuffled(): List<T>

Returns a new list with the elements of this list randomly shuffled.

Since Kotlin

1.2
single
Link copied to clipboard
fun <T> Array<out T>.single(): T
fun BooleanArray.single(): Boolean
fun ByteArray.single(): Byte
fun CharArray.single(): Char
fun DoubleArray.single(): Double
fun FloatArray.single(): Float
fun IntArray.single(): Int
fun LongArray.single(): Long
fun ShortArray.single(): Short

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

inline fun UByteArray.single(): UByte
inline fun UIntArray.single(): UInt
inline fun ULongArray.single(): ULong
inline fun UShortArray.single(): UShort

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

Since Kotlin

1.3
fun <T> Iterable<T>.single(): T

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

fun <T> List<T>.single(): T

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

inline fun <T> Array<out T>.single(predicate: (T) -> Boolean): T
inline fun BooleanArray.single(predicate: (Boolean) -> Boolean): Boolean
inline fun ByteArray.single(predicate: (Byte) -> Boolean): Byte
inline fun CharArray.single(predicate: (Char) -> Boolean): Char
inline fun DoubleArray.single(predicate: (Double) -> Boolean): Double
inline fun FloatArray.single(predicate: (Float) -> Boolean): Float
inline fun IntArray.single(predicate: (Int) -> Boolean): Int
inline fun LongArray.single(predicate: (Long) -> Boolean): Long
inline fun ShortArray.single(predicate: (Short) -> Boolean): Short
inline fun <T> Iterable<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.

inline fun UByteArray.single(predicate: (UByte) -> Boolean): UByte
inline fun UIntArray.single(predicate: (UInt) -> Boolean): UInt
inline fun ULongArray.single(predicate: (ULong) -> Boolean): ULong
inline fun UShortArray.single(predicate: (UShort) -> Boolean): UShort

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

Since Kotlin

1.3
singleOrNull
Link copied to clipboard
fun <T> Array<out T>.singleOrNull(): T?
fun BooleanArray.singleOrNull(): Boolean?
fun ByteArray.singleOrNull(): Byte?
fun CharArray.singleOrNull(): Char?
fun DoubleArray.singleOrNull(): Double?
fun FloatArray.singleOrNull(): Float?
fun IntArray.singleOrNull(): Int?
fun LongArray.singleOrNull(): Long?
fun ShortArray.singleOrNull(): Short?

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

fun UByteArray.singleOrNull(): UByte?
fun UIntArray.singleOrNull(): UInt?
fun ULongArray.singleOrNull(): ULong?
fun UShortArray.singleOrNull(): UShort?

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

Since Kotlin

1.3
fun <T> Iterable<T>.singleOrNull(): T?

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

fun <T> List<T>.singleOrNull(): T?

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

inline fun <T> Array<out T>.singleOrNull(predicate: (T) -> Boolean): T?
inline fun BooleanArray.singleOrNull(predicate: (Boolean) -> Boolean): Boolean?
inline fun ByteArray.singleOrNull(predicate: (Byte) -> Boolean): Byte?
inline fun CharArray.singleOrNull(predicate: (Char) -> Boolean): Char?
inline fun DoubleArray.singleOrNull(predicate: (Double) -> Boolean): Double?
inline fun FloatArray.singleOrNull(predicate: (Float) -> Boolean): Float?
inline fun IntArray.singleOrNull(predicate: (Int) -> Boolean): Int?
inline fun LongArray.singleOrNull(predicate: (Long) -> Boolean): Long?
inline fun ShortArray.singleOrNull(predicate: (Short) -> Boolean): Short?
inline fun <T> Iterable<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.

inline fun UByteArray.singleOrNull(predicate: (UByte) -> Boolean): UByte?
inline fun UIntArray.singleOrNull(predicate: (UInt) -> Boolean): UInt?
inline fun ULongArray.singleOrNull(predicate: (ULong) -> Boolean): ULong?
inline fun UShortArray.singleOrNull(predicate: (UShort) -> Boolean): UShort?

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

Since Kotlin

1.3
slice
Link copied to clipboard
fun <T> Array<out T>.slice(indices: Iterable<Int>): List<T>
fun BooleanArray.slice(indices: Iterable<Int>): List<Boolean>
fun ByteArray.slice(indices: Iterable<Int>): List<Byte>
fun CharArray.slice(indices: Iterable<Int>): List<Char>
fun DoubleArray.slice(indices: Iterable<Int>): List<Double>
fun FloatArray.slice(indices: Iterable<Int>): List<Float>
fun IntArray.slice(indices: Iterable<Int>): List<Int>
fun LongArray.slice(indices: Iterable<Int>): List<Long>
fun ShortArray.slice(indices: Iterable<Int>): List<Short>
fun <T> List<T>.slice(indices: Iterable<Int>): List<T>

Returns a list containing elements at specified indices.

fun <T> Array<out T>.slice(indices: IntRange): List<T>
fun BooleanArray.slice(indices: IntRange): List<Boolean>
fun ByteArray.slice(indices: IntRange): List<Byte>
fun CharArray.slice(indices: IntRange): List<Char>
fun DoubleArray.slice(indices: IntRange): List<Double>
fun FloatArray.slice(indices: IntRange): List<Float>
fun IntArray.slice(indices: IntRange): List<Int>
fun LongArray.slice(indices: IntRange): List<Long>
fun ShortArray.slice(indices: IntRange): List<Short>
fun <T> List<T>.slice(indices: IntRange): List<T>

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

fun UByteArray.slice(indices: Iterable<Int>): List<UByte>
fun UIntArray.slice(indices: Iterable<Int>): List<UInt>
fun ULongArray.slice(indices: Iterable<Int>): List<ULong>
fun UShortArray.slice(indices: Iterable<Int>): List<UShort>

Returns a list containing elements at specified indices.

Since Kotlin

1.3
fun UByteArray.slice(indices: IntRange): List<UByte>
fun UIntArray.slice(indices: IntRange): List<UInt>
fun ULongArray.slice(indices: IntRange): List<ULong>
fun UShortArray.slice(indices: IntRange): List<UShort>

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

Since Kotlin

1.3
sliceArray
Link copied to clipboard
fun <T> Array<T>.sliceArray(indices: Collection<Int>): Array<T>
fun BooleanArray.sliceArray(indices: Collection<Int>): BooleanArray
fun ByteArray.sliceArray(indices: Collection<Int>): ByteArray
fun CharArray.sliceArray(indices: Collection<Int>): CharArray
fun DoubleArray.sliceArray(indices: Collection<Int>): DoubleArray
fun FloatArray.sliceArray(indices: Collection<Int>): FloatArray
fun IntArray.sliceArray(indices: Collection<Int>): IntArray
fun LongArray.sliceArray(indices: Collection<Int>): LongArray
fun ShortArray.sliceArray(indices: Collection<Int>): ShortArray

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

fun <T> Array<T>.sliceArray(indices: IntRange): Array<T>
fun BooleanArray.sliceArray(indices: IntRange): BooleanArray
fun ByteArray.sliceArray(indices: IntRange): ByteArray
fun CharArray.sliceArray(indices: IntRange): CharArray
fun DoubleArray.sliceArray(indices: IntRange): DoubleArray
fun FloatArray.sliceArray(indices: IntRange): FloatArray
fun IntArray.sliceArray(indices: IntRange): IntArray
fun LongArray.sliceArray(indices: IntRange): LongArray
fun ShortArray.sliceArray(indices: IntRange): ShortArray

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

fun UByteArray.sliceArray(indices: Collection<Int>): UByteArray
fun UIntArray.sliceArray(indices: Collection<Int>): UIntArray
fun ULongArray.sliceArray(indices: Collection<Int>): ULongArray
fun UShortArray.sliceArray(indices: Collection<Int>): UShortArray

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

Since Kotlin

1.3
fun UByteArray.sliceArray(indices: IntRange): UByteArray
fun UIntArray.sliceArray(indices: IntRange): UIntArray
fun ULongArray.sliceArray(indices: IntRange): ULongArray
fun UShortArray.sliceArray(indices: IntRange): UShortArray

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

Since Kotlin

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

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

expect fun ByteArray.sort()
expect fun CharArray.sort()
expect fun DoubleArray.sort()
expect fun FloatArray.sort()
expect fun IntArray.sort()
expect fun LongArray.sort()
expect fun ShortArray.sort()

Sorts the array in-place.

fun UByteArray.sort()
fun UIntArray.sort()
fun ULongArray.sort()
fun UShortArray.sort()

Sorts the array in-place.

Since Kotlin

1.3
expect fun <T : Comparable<T>> MutableList<T>.sort()
expect fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int, toIndex: Int)
expect fun ByteArray.sort(fromIndex: Int, toIndex: Int)
expect fun CharArray.sort(fromIndex: Int, toIndex: Int)
expect fun DoubleArray.sort(fromIndex: Int, toIndex: Int)
expect fun FloatArray.sort(fromIndex: Int, toIndex: Int)
expect fun IntArray.sort(fromIndex: Int, toIndex: Int)
expect fun LongArray.sort(fromIndex: Int, toIndex: Int)
expect fun ShortArray.sort(fromIndex: Int, toIndex: Int)
fun UByteArray.sort(fromIndex: Int = 0, toIndex: Int = size)
fun UIntArray.sort(fromIndex: Int = 0, toIndex: Int = size)
fun ULongArray.sort(fromIndex: Int = 0, toIndex: Int = size)
fun UShortArray.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

Since Kotlin

1.4
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.

actual fun ByteArray.sort()
actual fun CharArray.sort()
actual fun DoubleArray.sort()
actual fun FloatArray.sort()
actual fun IntArray.sort()
actual fun LongArray.sort()
actual fun ShortArray.sort()

Sorts the array in-place.

actual fun <T : Comparable<T>> MutableList<T>.sort()

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

inline fun <T> MutableList<T>.sort(comparator: Comparator<in T>)
inline fun <T> MutableList<T>.sort(comparison: (T, T) -> Int)

fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size)
actual fun ByteArray.sort(fromIndex: Int, toIndex: Int)
actual fun CharArray.sort(fromIndex: Int, toIndex: Int)
actual fun DoubleArray.sort(fromIndex: Int, toIndex: Int)
actual fun FloatArray.sort(fromIndex: Int, toIndex: Int)
actual fun IntArray.sort(fromIndex: Int, toIndex: Int)
actual fun LongArray.sort(fromIndex: Int, toIndex: Int)
actual fun ShortArray.sort(fromIndex: Int, toIndex: Int)

Sorts a range in the array in-place.

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

Sorts a range in the array in-place.

Since Kotlin

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

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

actual fun ByteArray.sort()
actual fun CharArray.sort()
actual fun DoubleArray.sort()
actual fun FloatArray.sort()
actual fun IntArray.sort()
actual fun LongArray.sort()
actual fun ShortArray.sort()

Sorts the array in-place.

actual fun <T : Comparable<T>> MutableList<T>.sort()

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

fun <T> Array<out T>.sort(comparison: (T, T) -> Int)
inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int)
inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int)
inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int)
inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> Int)
inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int)
inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int)
inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> 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(fromIndex: Int, toIndex: Int)
actual fun ByteArray.sort(fromIndex: Int, toIndex: Int)
actual fun CharArray.sort(fromIndex: Int, toIndex: Int)
actual fun DoubleArray.sort(fromIndex: Int, toIndex: Int)
actual fun FloatArray.sort(fromIndex: Int, toIndex: Int)
actual fun IntArray.sort(fromIndex: Int, toIndex: Int)
actual fun LongArray.sort(fromIndex: Int, toIndex: Int)
actual fun ShortArray.sort(fromIndex: Int, toIndex: Int)

Sorts a range in the array in-place.

Since Kotlin

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

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

actual fun ByteArray.sort()
actual fun CharArray.sort()
actual fun DoubleArray.sort()
actual fun FloatArray.sort()
actual fun IntArray.sort()
actual fun LongArray.sort()
actual fun ShortArray.sort()

Sorts the array in-place.

actual fun <T : Comparable<T>> MutableList<T>.sort()

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

actual fun <T : Comparable<T>> Array<out T>.sort(fromIndex: Int, toIndex: Int)
actual fun ByteArray.sort(fromIndex: Int, toIndex: Int)
actual fun CharArray.sort(fromIndex: Int, toIndex: Int)
actual fun DoubleArray.sort(fromIndex: Int, toIndex: Int)
actual fun FloatArray.sort(fromIndex: Int, toIndex: Int)
actual fun IntArray.sort(fromIndex: Int, toIndex: Int)
actual fun LongArray.sort(fromIndex: Int, toIndex: Int)
actual fun ShortArray.sort(fromIndex: Int, toIndex: Int)

Sorts a range in the array in-place.

Since Kotlin

1.4
sortBy
Link copied to clipboard
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.

inline fun <T, R : Comparable<R>> MutableList<T>.sortBy(crossinline selector: (T) -> R?)

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

sortByDescending
Link copied to clipboard
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.

inline fun <T, R : Comparable<R>> MutableList<T>.sortByDescending(crossinline selector: (T) -> R?)

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

sortDescending
Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.sortDescending()
fun ByteArray.sortDescending()
fun CharArray.sortDescending()
fun DoubleArray.sortDescending()
fun FloatArray.sortDescending()
fun IntArray.sortDescending()
fun LongArray.sortDescending()
fun ShortArray.sortDescending()

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

fun UByteArray.sortDescending()
fun UIntArray.sortDescending()
fun ULongArray.sortDescending()
fun UShortArray.sortDescending()

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

Since Kotlin

1.3
fun <T : Comparable<T>> MutableList<T>.sortDescending()

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

fun <T : Comparable<T>> Array<out T>.sortDescending(fromIndex: Int, toIndex: Int)
fun ByteArray.sortDescending(fromIndex: Int, toIndex: Int)
fun CharArray.sortDescending(fromIndex: Int, toIndex: Int)
fun DoubleArray.sortDescending(fromIndex: Int, toIndex: Int)
fun FloatArray.sortDescending(fromIndex: Int, toIndex: Int)
fun IntArray.sortDescending(fromIndex: Int, toIndex: Int)
fun LongArray.sortDescending(fromIndex: Int, toIndex: Int)
fun ShortArray.sortDescending(fromIndex: Int, toIndex: Int)
fun UByteArray.sortDescending(fromIndex: Int, toIndex: Int)
fun UIntArray.sortDescending(fromIndex: Int, toIndex: Int)
fun ULongArray.sortDescending(fromIndex: Int, toIndex: Int)
fun UShortArray.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.

Since Kotlin

1.4
sorted
Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.sorted(): List<T>
fun ByteArray.sorted(): List<Byte>
fun CharArray.sorted(): List<Char>
fun DoubleArray.sorted(): List<Double>
fun FloatArray.sorted(): List<Float>
fun IntArray.sorted(): List<Int>
fun LongArray.sorted(): List<Long>
fun ShortArray.sorted(): List<Short>
fun <T : Comparable<T>> Iterable<T>.sorted(): List<T>

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

fun UByteArray.sorted(): List<UByte>
fun UIntArray.sorted(): List<UInt>
fun ULongArray.sorted(): List<ULong>
fun UShortArray.sorted(): List<UShort>

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

Since Kotlin

1.3
sortedArray
Link copied to clipboard
fun <T : Comparable<T>> Array<T>.sortedArray(): Array<T>
fun ByteArray.sortedArray(): ByteArray
fun CharArray.sortedArray(): CharArray
fun DoubleArray.sortedArray(): DoubleArray
fun FloatArray.sortedArray(): FloatArray
fun IntArray.sortedArray(): IntArray
fun LongArray.sortedArray(): LongArray
fun ShortArray.sortedArray(): ShortArray

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

fun UIntArray.sortedArray(): UIntArray

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

Since Kotlin

1.3
sortedArrayDescending
Link copied to clipboard
fun <T : Comparable<T>> Array<T>.sortedArrayDescending(): Array<T>
fun ByteArray.sortedArrayDescending(): ByteArray
fun CharArray.sortedArrayDescending(): CharArray
fun DoubleArray.sortedArrayDescending(): DoubleArray
fun FloatArray.sortedArrayDescending(): FloatArray
fun IntArray.sortedArrayDescending(): IntArray
fun LongArray.sortedArrayDescending(): LongArray
fun ShortArray.sortedArrayDescending(): ShortArray

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

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

Since Kotlin

1.3
sortedArrayWith
Link copied to clipboard
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.

sortedBy
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selector: (T) -> R?): List<T>
inline fun <R : Comparable<R>> BooleanArray.sortedBy(crossinline selector: (Boolean) -> R?): List<Boolean>
inline fun <R : Comparable<R>> ByteArray.sortedBy(crossinline selector: (Byte) -> R?): List<Byte>
inline fun <R : Comparable<R>> CharArray.sortedBy(crossinline selector: (Char) -> R?): List<Char>
inline fun <R : Comparable<R>> DoubleArray.sortedBy(crossinline selector: (Double) -> R?): List<Double>
inline fun <R : Comparable<R>> FloatArray.sortedBy(crossinline selector: (Float) -> R?): List<Float>
inline fun <R : Comparable<R>> IntArray.sortedBy(crossinline selector: (Int) -> R?): List<Int>
inline fun <R : Comparable<R>> LongArray.sortedBy(crossinline selector: (Long) -> R?): List<Long>
inline fun <R : Comparable<R>> ShortArray.sortedBy(crossinline selector: (Short) -> R?): List<Short>
inline fun <T, R : Comparable<R>> Iterable<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.

sortedByDescending
Link copied to clipboard
inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(crossinline selector: (T) -> R?): List<T>
inline fun <R : Comparable<R>> BooleanArray.sortedByDescending(crossinline selector: (Boolean) -> R?): List<Boolean>
inline fun <R : Comparable<R>> ByteArray.sortedByDescending(crossinline selector: (Byte) -> R?): List<Byte>
inline fun <R : Comparable<R>> CharArray.sortedByDescending(crossinline selector: (Char) -> R?): List<Char>
inline fun <R : Comparable<R>> DoubleArray.sortedByDescending(crossinline selector: (Double) -> R?): List<Double>
inline fun <R : Comparable<R>> FloatArray.sortedByDescending(crossinline selector: (Float) -> R?): List<Float>
inline fun <R : Comparable<R>> IntArray.sortedByDescending(crossinline selector: (Int) -> R?): List<Int>
inline fun <R : Comparable<R>> LongArray.sortedByDescending(crossinline selector: (Long) -> R?): List<Long>
inline fun <R : Comparable<R>> ShortArray.sortedByDescending(crossinline selector: (Short) -> R?): List<Short>
inline fun <T, R : Comparable<R>> Iterable<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.

sortedDescending
Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.sortedDescending(): List<T>
fun ByteArray.sortedDescending(): List<Byte>
fun CharArray.sortedDescending(): List<Char>
fun DoubleArray.sortedDescending(): List<Double>
fun FloatArray.sortedDescending(): List<Float>
fun IntArray.sortedDescending(): List<Int>
fun LongArray.sortedDescending(): List<Long>
fun ShortArray.sortedDescending(): List<Short>
fun <T : Comparable<T>> Iterable<T>.sortedDescending(): List<T>

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

fun UIntArray.sortedDescending(): List<UInt>

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

Since Kotlin

1.3
sortedMapOf
Link copied to clipboard
fun <K : Comparable<K>, V> sortedMapOf(vararg pairs: Pair<K, V>): SortedMap<K, V>

Returns a new SortedMap with the specified contents, given as a list of pairs where the first value is the key and the second is the value.

fun <K, V> sortedMapOf(comparator: Comparator<in K>, vararg pairs: Pair<K, V>): SortedMap<K, V>

Returns a new SortedMap with the specified contents, given as a list of pairs where the first value is the key and the second is the value.

Since Kotlin

1.4
sortedSetOf
Link copied to clipboard
fun <T> sortedSetOf(vararg elements: T): TreeSet<T>

Returns a new java.util.SortedSet with the given elements.

fun <T> sortedSetOf(comparator: Comparator<in T>, vararg elements: T): TreeSet<T>

Returns a new java.util.SortedSet with the given comparator and elements.

sortedWith
Link copied to clipboard
fun <T> Array<out T>.sortedWith(comparator: Comparator<in T>): List<T>
fun BooleanArray.sortedWith(comparator: Comparator<in Boolean>): List<Boolean>
fun ByteArray.sortedWith(comparator: Comparator<in Byte>): List<Byte>
fun CharArray.sortedWith(comparator: Comparator<in Char>): List<Char>
fun DoubleArray.sortedWith(comparator: Comparator<in Double>): List<Double>
fun FloatArray.sortedWith(comparator: Comparator<in Float>): List<Float>
fun IntArray.sortedWith(comparator: Comparator<in Int>): List<Int>
fun LongArray.sortedWith(comparator: Comparator<in Long>): List<Long>
fun ShortArray.sortedWith(comparator: Comparator<in Short>): List<Short>
fun <T> Iterable<T>.sortedWith(comparator: Comparator<in T>): List<T>

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

sortWith
Link copied to clipboard
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> MutableList<T>.sortWith(comparator: Comparator<in T>)
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>)

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

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

Sorts elements in the list in-place according to the order specified with comparator.

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.

Since Kotlin

1.4
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> MutableList<T>.sortWith(comparator: Comparator<in T>)

Sorts elements in the list in-place according to the order specified with comparator.

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.

stringMapOf
Link copied to clipboard
fun <V> stringMapOf(vararg pairs: Pair<String, V>): HashMap<String, V>

Constructs the specialized implementation of HashMap with String keys, which stores the keys as properties of JS object without hashing them.

stringSetOf
Link copied to clipboard
fun stringSetOf(vararg elements: String): HashSet<String>

Creates a new instance of the specialized implementation of HashSet with the specified String elements, which elements the keys as properties of JS object without hashing them.

subarrayContentToString
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
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.

subtract
Link copied to clipboard
infix fun <T> Array<out T>.subtract(other: Iterable<T>): Set<T>
infix fun BooleanArray.subtract(other: Iterable<Boolean>): Set<Boolean>
infix fun ByteArray.subtract(other: Iterable<Byte>): Set<Byte>
infix fun CharArray.subtract(other: Iterable<Char>): Set<Char>
infix fun DoubleArray.subtract(other: Iterable<Double>): Set<Double>
infix fun FloatArray.subtract(other: Iterable<Float>): Set<Float>
infix fun IntArray.subtract(other: Iterable<Int>): Set<Int>
infix fun LongArray.subtract(other: Iterable<Long>): Set<Long>
infix fun ShortArray.subtract(other: Iterable<Short>): Set<Short>

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

infix fun <T> Iterable<T>.subtract(other: Iterable<T>): Set<T>

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

sum
Link copied to clipboard
@JvmName(name = "sumOfByte")
fun Array<out Byte>.sum(): Int
@JvmName(name = "sumOfDouble")
fun Array<out Double>.sum(): Double
@JvmName(name = "sumOfFloat")
fun Array<out Float>.sum(): Float
@JvmName(name = "sumOfInt")
fun Array<out Int>.sum(): Int
@JvmName(name = "sumOfLong")
fun Array<out Long>.sum(): Long
@JvmName(name = "sumOfShort")
fun Array<out Short>.sum(): Int
fun ByteArray.sum(): Int
fun DoubleArray.sum(): Double
fun FloatArray.sum(): Float
fun IntArray.sum(): Int
fun LongArray.sum(): Long
fun ShortArray.sum(): Int

Returns the sum of all elements in the array.

@JvmName(name = "sumOfUByte")
fun Array<out UByte>.sum(): UInt
@JvmName(name = "sumOfUInt")
fun Array<out UInt>.sum(): UInt
@JvmName(name = "sumOfULong")
fun Array<out ULong>.sum(): ULong
@JvmName(name = "sumOfUShort")
fun Array<out UShort>.sum(): UInt

Returns the sum of all elements in the array.

Since Kotlin

1.5
inline fun UByteArray.sum(): UInt
inline fun UIntArray.sum(): UInt
inline fun ULongArray.sum(): ULong
inline fun UShortArray.sum(): UInt

Returns the sum of all elements in the array.

Since Kotlin

1.3
@JvmName(name = "sumOfByte")
fun Iterable<Byte>.sum(): Int
@JvmName(name = "sumOfDouble")
fun Iterable<Double>.sum(): Double
@JvmName(name = "sumOfFloat")
fun Iterable<Float>.sum(): Float
@JvmName(name = "sumOfInt")
fun Iterable<Int>.sum(): Int
@JvmName(name = "sumOfLong")
fun Iterable<Long>.sum(): Long
@JvmName(name = "sumOfShort")
fun Iterable<Short>.sum(): Int

Returns the sum of all elements in the collection.

@JvmName(name = "sumOfUByte")
fun Iterable<UByte>.sum(): UInt
@JvmName(name = "sumOfUInt")
fun Iterable<UInt>.sum(): UInt
@JvmName(name = "sumOfULong")
fun Iterable<ULong>.sum(): ULong
@JvmName(name = "sumOfUShort")
fun Iterable<UShort>.sum(): UInt

Returns the sum of all elements in the collection.

Since Kotlin

1.5
sumBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun <T> Array<out T>.sumBy(selector: (T) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun BooleanArray.sumBy(selector: (Boolean) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun ByteArray.sumBy(selector: (Byte) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun CharArray.sumBy(selector: (Char) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun DoubleArray.sumBy(selector: (Double) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun FloatArray.sumBy(selector: (Float) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun IntArray.sumBy(selector: (Int) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun LongArray.sumBy(selector: (Long) -> Int): Int
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun ShortArray.sumBy(selector: (Short) -> Int): Int

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

inline fun UByteArray.sumBy(selector: (UByte) -> UInt): UInt
inline fun UIntArray.sumBy(selector: (UInt) -> UInt): UInt
inline fun ULongArray.sumBy(selector: (ULong) -> UInt): UInt
inline fun UShortArray.sumBy(selector: (UShort) -> UInt): UInt

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

Since Kotlin

1.3
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun <T> Iterable<T>.sumBy(selector: (T) -> Int): Int

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

sumByDouble
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun <T> Array<out T>.sumByDouble(selector: (T) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun BooleanArray.sumByDouble(selector: (Boolean) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun ByteArray.sumByDouble(selector: (Byte) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun CharArray.sumByDouble(selector: (Char) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun DoubleArray.sumByDouble(selector: (Double) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun FloatArray.sumByDouble(selector: (Float) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun IntArray.sumByDouble(selector: (Int) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun LongArray.sumByDouble(selector: (Long) -> Double): Double
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun ShortArray.sumByDouble(selector: (Short) -> Double): Double

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

inline fun UByteArray.sumByDouble(selector: (UByte) -> Double): Double
inline fun UIntArray.sumByDouble(selector: (UInt) -> Double): Double
inline fun ULongArray.sumByDouble(selector: (ULong) -> Double): Double
inline fun UShortArray.sumByDouble(selector: (UShort) -> Double): Double

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

Since Kotlin

1.3
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun <T> Iterable<T>.sumByDouble(selector: (T) -> Double): Double

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

sumOf
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 = "sumOfDouble")
inline fun BooleanArray.sumOf(selector: (Boolean) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun BooleanArray.sumOf(selector: (Boolean) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun BooleanArray.sumOf(selector: (Boolean) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun ByteArray.sumOf(selector: (Byte) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun ByteArray.sumOf(selector: (Byte) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun ByteArray.sumOf(selector: (Byte) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun CharArray.sumOf(selector: (Char) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun CharArray.sumOf(selector: (Char) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun CharArray.sumOf(selector: (Char) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun DoubleArray.sumOf(selector: (Double) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun DoubleArray.sumOf(selector: (Double) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun DoubleArray.sumOf(selector: (Double) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun FloatArray.sumOf(selector: (Float) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun FloatArray.sumOf(selector: (Float) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun FloatArray.sumOf(selector: (Float) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun IntArray.sumOf(selector: (Int) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun IntArray.sumOf(selector: (Int) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun IntArray.sumOf(selector: (Int) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun LongArray.sumOf(selector: (Long) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun LongArray.sumOf(selector: (Long) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun LongArray.sumOf(selector: (Long) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun ShortArray.sumOf(selector: (Short) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun ShortArray.sumOf(selector: (Short) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun ShortArray.sumOf(selector: (Short) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun UByteArray.sumOf(selector: (UByte) -> Double): Double
inline fun UByteArray.sumOf(selector: (UByte) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun UByteArray.sumOf(selector: (UByte) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun UIntArray.sumOf(selector: (UInt) -> Double): Double
inline fun UIntArray.sumOf(selector: (UInt) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun UIntArray.sumOf(selector: (UInt) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun ULongArray.sumOf(selector: (ULong) -> Double): Double
inline fun ULongArray.sumOf(selector: (ULong) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun ULongArray.sumOf(selector: (ULong) -> Long): Long
@JvmName(name = "sumOfDouble")
inline fun UShortArray.sumOf(selector: (UShort) -> Double): Double
inline fun UShortArray.sumOf(selector: (UShort) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun UShortArray.sumOf(selector: (UShort) -> Long): Long

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

Since Kotlin

1.4
@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 = "sumOfUInt")
inline fun BooleanArray.sumOf(selector: (Boolean) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun BooleanArray.sumOf(selector: (Boolean) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun ByteArray.sumOf(selector: (Byte) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun ByteArray.sumOf(selector: (Byte) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun CharArray.sumOf(selector: (Char) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun CharArray.sumOf(selector: (Char) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun DoubleArray.sumOf(selector: (Double) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun DoubleArray.sumOf(selector: (Double) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun FloatArray.sumOf(selector: (Float) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun FloatArray.sumOf(selector: (Float) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun IntArray.sumOf(selector: (Int) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun IntArray.sumOf(selector: (Int) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun LongArray.sumOf(selector: (Long) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun LongArray.sumOf(selector: (Long) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun ShortArray.sumOf(selector: (Short) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun ShortArray.sumOf(selector: (Short) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun UByteArray.sumOf(selector: (UByte) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun UByteArray.sumOf(selector: (UByte) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun UIntArray.sumOf(selector: (UInt) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun UIntArray.sumOf(selector: (UInt) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun ULongArray.sumOf(selector: (ULong) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun ULongArray.sumOf(selector: (ULong) -> ULong): ULong
@JvmName(name = "sumOfUInt")
inline fun UShortArray.sumOf(selector: (UShort) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun UShortArray.sumOf(selector: (UShort) -> ULong): ULong

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

Since Kotlin

1.5
@JvmName(name = "sumOfDouble")
inline fun <T> Iterable<T>.sumOf(selector: (T) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun <T> Iterable<T>.sumOf(selector: (T) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun <T> Iterable<T>.sumOf(selector: (T) -> Long): Long

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

Since Kotlin

1.4
@JvmName(name = "sumOfUInt")
inline fun <T> Iterable<T>.sumOf(selector: (T) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun <T> Iterable<T>.sumOf(selector: (T) -> ULong): ULong

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

Since Kotlin

1.5
@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 BooleanArray.sumOf(selector: (Boolean) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun BooleanArray.sumOf(selector: (Boolean) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun ByteArray.sumOf(selector: (Byte) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun ByteArray.sumOf(selector: (Byte) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun CharArray.sumOf(selector: (Char) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun CharArray.sumOf(selector: (Char) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun DoubleArray.sumOf(selector: (Double) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun DoubleArray.sumOf(selector: (Double) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun FloatArray.sumOf(selector: (Float) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun FloatArray.sumOf(selector: (Float) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun IntArray.sumOf(selector: (Int) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun IntArray.sumOf(selector: (Int) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun LongArray.sumOf(selector: (Long) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun LongArray.sumOf(selector: (Long) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun ShortArray.sumOf(selector: (Short) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun ShortArray.sumOf(selector: (Short) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
@ExperimentalUnsignedTypes
inline fun UByteArray.sumOf(selector: (UByte) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun UByteArray.sumOf(selector: (UByte) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
@ExperimentalUnsignedTypes
inline fun UIntArray.sumOf(selector: (UInt) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun UIntArray.sumOf(selector: (UInt) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
@ExperimentalUnsignedTypes
inline fun ULongArray.sumOf(selector: (ULong) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun ULongArray.sumOf(selector: (ULong) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
@ExperimentalUnsignedTypes
inline fun UShortArray.sumOf(selector: (UShort) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun UShortArray.sumOf(selector: (UShort) -> BigInteger): BigInteger

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

Since Kotlin

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

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

Since Kotlin

1.4
take
Link copied to clipboard
fun <T> Array<out T>.take(n: Int): List<T>
fun BooleanArray.take(n: Int): List<Boolean>
fun ByteArray.take(n: Int): List<Byte>
fun CharArray.take(n: Int): List<Char>
fun DoubleArray.take(n: Int): List<Double>
fun FloatArray.take(n: Int): List<Float>
fun IntArray.take(n: Int): List<Int>
fun LongArray.take(n: Int): List<Long>
fun ShortArray.take(n: Int): List<Short>
fun <T> Iterable<T>.take(n: Int): List<T>

Returns a list containing first n elements.

fun UByteArray.take(n: Int): List<UByte>
fun UIntArray.take(n: Int): List<UInt>
fun ULongArray.take(n: Int): List<ULong>
fun UShortArray.take(n: Int): List<UShort>

Returns a list containing first n elements.

Since Kotlin

1.3
takeLast
Link copied to clipboard
fun <T> Array<out T>.takeLast(n: Int): List<T>
fun BooleanArray.takeLast(n: Int): List<Boolean>
fun ByteArray.takeLast(n: Int): List<Byte>
fun CharArray.takeLast(n: Int): List<Char>
fun DoubleArray.takeLast(n: Int): List<Double>
fun FloatArray.takeLast(n: Int): List<Float>
fun IntArray.takeLast(n: Int): List<Int>
fun LongArray.takeLast(n: Int): List<Long>
fun ShortArray.takeLast(n: Int): List<Short>
fun <T> List<T>.takeLast(n: Int): List<T>

Returns a list containing last n elements.

fun UByteArray.takeLast(n: Int): List<UByte>
fun UIntArray.takeLast(n: Int): List<UInt>
fun ULongArray.takeLast(n: Int): List<ULong>
fun UShortArray.takeLast(n: Int): List<UShort>

Returns a list containing last n elements.

Since Kotlin

1.3
takeLastWhile
Link copied to clipboard
inline fun <T> Array<out T>.takeLastWhile(predicate: (T) -> Boolean): List<T>
inline fun BooleanArray.takeLastWhile(predicate: (Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.takeLastWhile(predicate: (Byte) -> Boolean): List<Byte>
inline fun CharArray.takeLastWhile(predicate: (Char) -> Boolean): List<Char>
inline fun DoubleArray.takeLastWhile(predicate: (Double) -> Boolean): List<Double>
inline fun FloatArray.takeLastWhile(predicate: (Float) -> Boolean): List<Float>
inline fun IntArray.takeLastWhile(predicate: (Int) -> Boolean): List<Int>
inline fun LongArray.takeLastWhile(predicate: (Long) -> Boolean): List<Long>
inline fun ShortArray.takeLastWhile(predicate: (Short) -> Boolean): List<Short>
inline fun <T> List<T>.takeLastWhile(predicate: (T) -> Boolean): List<T>

Returns a list containing last elements satisfying the given predicate.

inline fun UByteArray.takeLastWhile(predicate: (UByte) -> Boolean): List<UByte>
inline fun UIntArray.takeLastWhile(predicate: (UInt) -> Boolean): List<UInt>
inline fun ULongArray.takeLastWhile(predicate: (ULong) -> Boolean): List<ULong>
inline fun UShortArray.takeLastWhile(predicate: (UShort) -> Boolean): List<UShort>

Returns a list containing last elements satisfying the given predicate.

Since Kotlin

1.3
takeWhile
Link copied to clipboard
inline fun <T> Array<out T>.takeWhile(predicate: (T) -> Boolean): List<T>
inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List<Boolean>
inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List<Byte>
inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List<Char>
inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List<Double>
inline fun FloatArray.takeWhile(predicate: (Float) -> Boolean): List<Float>
inline fun IntArray.takeWhile(predicate: (Int) -> Boolean): List<Int>
inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List<Long>
inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List<Short>
inline fun <T> Iterable<T>.takeWhile(predicate: (T) -> Boolean): List<T>

Returns a list containing first elements satisfying the given predicate.

inline fun UByteArray.takeWhile(predicate: (UByte) -> Boolean): List<UByte>
inline fun UIntArray.takeWhile(predicate: (UInt) -> Boolean): List<UInt>
inline fun ULongArray.takeWhile(predicate: (ULong) -> Boolean): List<ULong>
inline fun UShortArray.takeWhile(predicate: (UShort) -> Boolean): List<UShort>

Returns a list containing first elements satisfying the given predicate.

Since Kotlin

1.3
toBooleanArray
Link copied to clipboard
fun Array<out Boolean>.toBooleanArray(): BooleanArray

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

fun Collection<Boolean>.toBooleanArray(): BooleanArray

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

toByteArray
Link copied to clipboard
fun Array<out Byte>.toByteArray(): ByteArray

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

inline fun UByteArray.toByteArray(): ByteArray

Returns an array of type ByteArray, which is a copy of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
fun Collection<Byte>.toByteArray(): ByteArray

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

toCharArray
Link copied to clipboard
fun Array<out Char>.toCharArray(): CharArray

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

fun Collection<Char>.toCharArray(): CharArray

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

toCollection
Link copied to clipboard
fun <T, C : MutableCollection<in T>> Array<out T>.toCollection(destination: C): C
fun <C : MutableCollection<in Boolean>> BooleanArray.toCollection(destination: C): C
fun <C : MutableCollection<in Byte>> ByteArray.toCollection(destination: C): C
fun <C : MutableCollection<in Char>> CharArray.toCollection(destination: C): C
fun <C : MutableCollection<in Double>> DoubleArray.toCollection(destination: C): C
fun <C : MutableCollection<in Float>> FloatArray.toCollection(destination: C): C
fun <C : MutableCollection<in Int>> IntArray.toCollection(destination: C): C
fun <C : MutableCollection<in Long>> LongArray.toCollection(destination: C): C
fun <C : MutableCollection<in Short>> ShortArray.toCollection(destination: C): C
fun <T, C : MutableCollection<in T>> Iterable<T>.toCollection(destination: C): C

Appends all elements to the given destination collection.

toDoubleArray
Link copied to clipboard
fun Array<out Double>.toDoubleArray(): DoubleArray

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

fun Collection<Double>.toDoubleArray(): DoubleArray

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

toFloatArray
Link copied to clipboard
fun Array<out Float>.toFloatArray(): FloatArray

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

fun Collection<Float>.toFloatArray(): FloatArray

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

toHashSet
Link copied to clipboard
fun <T> Array<out T>.toHashSet(): HashSet<T>
fun BooleanArray.toHashSet(): HashSet<Boolean>
fun ByteArray.toHashSet(): HashSet<Byte>
fun CharArray.toHashSet(): HashSet<Char>
fun DoubleArray.toHashSet(): HashSet<Double>
fun FloatArray.toHashSet(): HashSet<Float>
fun IntArray.toHashSet(): HashSet<Int>
fun LongArray.toHashSet(): HashSet<Long>
fun ShortArray.toHashSet(): HashSet<Short>
fun <T> Iterable<T>.toHashSet(): HashSet<T>

Returns a new HashSet of all elements.

toIntArray
Link copied to clipboard
fun Array<out Int>.toIntArray(): IntArray

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

inline fun UIntArray.toIntArray(): IntArray

Returns an array of type IntArray, which is a copy of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
fun Collection<Int>.toIntArray(): IntArray

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

toList
Link copied to clipboard
fun <T> Array<out T>.toList(): List<T>
fun BooleanArray.toList(): List<Boolean>
fun ByteArray.toList(): List<Byte>
fun CharArray.toList(): List<Char>
fun DoubleArray.toList(): List<Double>
fun FloatArray.toList(): List<Float>
fun IntArray.toList(): List<Int>
fun LongArray.toList(): List<Long>
fun ShortArray.toList(): List<Short>
fun <T> Iterable<T>.toList(): List<T>

Returns a List containing all elements.

fun <K, V> Map<out K, V>.toList(): List<Pair<K, V>>

Returns a List containing all key-value pairs.

inline fun <T> Enumeration<T>.toList(): List<T>

Returns a list containing the elements returned by this enumeration in the order they are returned by the enumeration.

toLongArray
Link copied to clipboard
fun Array<out Long>.toLongArray(): LongArray

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

inline fun ULongArray.toLongArray(): LongArray

Returns an array of type LongArray, which is a copy of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
fun Collection<Long>.toLongArray(): LongArray

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

toMap
Link copied to clipboard
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> Iterable<Pair<K, V>>.toMap(): Map<K, V>

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

fun <K, V> Map<out K, V>.toMap(): Map<K, V>

Returns a new read-only map containing all key-value pairs from the original map.

Since Kotlin

1.1
fun <K, V> Sequence<Pair<K, V>>.toMap(): Map<K, V>

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

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.

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

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

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

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

Since Kotlin

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

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

toMutableList
Link copied to clipboard
fun <T> Array<out T>.toMutableList(): MutableList<T>
fun BooleanArray.toMutableList(): MutableList<Boolean>
fun ByteArray.toMutableList(): MutableList<Byte>
fun CharArray.toMutableList(): MutableList<Char>
fun DoubleArray.toMutableList(): MutableList<Double>
fun FloatArray.toMutableList(): MutableList<Float>
fun IntArray.toMutableList(): MutableList<Int>
fun LongArray.toMutableList(): MutableList<Long>
fun ShortArray.toMutableList(): MutableList<Short>

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

fun <T> Collection<T>.toMutableList(): MutableList<T>
fun <T> Iterable<T>.toMutableList(): MutableList<T>

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

toMutableMap
Link copied to clipboard
fun <K, V> Map<out K, V>.toMutableMap(): MutableMap<K, V>

Returns a new mutable map containing all key-value pairs from the original map.

Since Kotlin

1.1
toMutableSet
Link copied to clipboard
fun <T> Array<out T>.toMutableSet(): MutableSet<T>
fun BooleanArray.toMutableSet(): MutableSet<Boolean>
fun ByteArray.toMutableSet(): MutableSet<Byte>
fun CharArray.toMutableSet(): MutableSet<Char>
fun DoubleArray.toMutableSet(): MutableSet<Double>
fun FloatArray.toMutableSet(): MutableSet<Float>
fun IntArray.toMutableSet(): MutableSet<Int>
fun LongArray.toMutableSet(): MutableSet<Long>
fun ShortArray.toMutableSet(): MutableSet<Short>

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

fun <T> Iterable<T>.toMutableSet(): MutableSet<T>

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

toPair
Link copied to clipboard
inline fun <K, V> Map.Entry<K, V>.toPair(): Pair<K, V>

Converts entry to Pair with key being first component and value being second.

toProperties
Link copied to clipboard
inline fun Map<String, String>.toProperties(): Properties

Converts this Map to a Properties object.

toSet
Link copied to clipboard
fun <T> Array<out T>.toSet(): Set<T>
fun BooleanArray.toSet(): Set<Boolean>
fun ByteArray.toSet(): Set<Byte>
fun CharArray.toSet(): Set<Char>
fun DoubleArray.toSet(): Set<Double>
fun FloatArray.toSet(): Set<Float>
fun IntArray.toSet(): Set<Int>
fun LongArray.toSet(): Set<Long>
fun ShortArray.toSet(): Set<Short>
fun <T> Iterable<T>.toSet(): Set<T>

Returns a Set of all elements.

toShortArray
Link copied to clipboard
fun Array<out Short>.toShortArray(): ShortArray

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

inline fun UShortArray.toShortArray(): ShortArray

Returns an array of type ShortArray, which is a copy of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin

1.3
fun Collection<Short>.toShortArray(): ShortArray

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

toSortedMap
Link copied to clipboard
fun <K : Comparable<K>, V> Map<out K, V>.toSortedMap(): SortedMap<K, V>

Converts this Map to a SortedMap. The resulting SortedMap determines the equality and order of keys according to their natural sorting order.

fun <K, V> Map<out K, V>.toSortedMap(comparator: Comparator<in K>): SortedMap<K, V>

Converts this Map to a SortedMap. The resulting SortedMap determines the equality and order of keys according to the sorting order provided by the given comparator.

toSortedSet
Link copied to clipboard
fun <T : Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T>
fun BooleanArray.toSortedSet(): SortedSet<Boolean>
fun ByteArray.toSortedSet(): SortedSet<Byte>
fun CharArray.toSortedSet(): SortedSet<Char>
fun DoubleArray.toSortedSet(): SortedSet<Double>
fun FloatArray.toSortedSet(): SortedSet<Float>
fun IntArray.toSortedSet(): SortedSet<Int>
fun LongArray.toSortedSet(): SortedSet<Long>
fun ShortArray.toSortedSet(): SortedSet<Short>
fun <T : Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T>
fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>
fun <T> Iterable<T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>

Returns a new SortedSet of all elements.

toString
Link copied to clipboard
inline fun ByteArray.toString(charset: Charset): String

Converts the contents of this byte array to a string using the specified charset.

toTypedArray
Link copied to clipboard
expect fun BooleanArray.toTypedArray(): Array<Boolean>
expect fun ByteArray.toTypedArray(): Array<Byte>
expect fun CharArray.toTypedArray(): Array<Char>
expect fun DoubleArray.toTypedArray(): Array<Double>
expect fun FloatArray.toTypedArray(): Array<Float>
expect fun IntArray.toTypedArray(): Array<Int>
expect fun LongArray.toTypedArray(): Array<Long>
expect fun ShortArray.toTypedArray(): Array<Short>

Returns a typed object array containing all of the elements of this primitive array.

fun UByteArray.toTypedArray(): Array<UByte>
fun UIntArray.toTypedArray(): Array<UInt>
fun ULongArray.toTypedArray(): Array<ULong>

Returns a typed object array containing all of the elements of this primitive array.

Since Kotlin

1.3
expect inline fun <T> Collection<T>.toTypedArray(): Array<T>
actual fun BooleanArray.toTypedArray(): Array<Boolean>
actual fun ByteArray.toTypedArray(): Array<Byte>
actual fun CharArray.toTypedArray(): Array<Char>
actual fun DoubleArray.toTypedArray(): Array<Double>
actual fun FloatArray.toTypedArray(): Array<Float>
actual fun IntArray.toTypedArray(): Array<Int>
actual fun LongArray.toTypedArray(): Array<Long>
actual fun ShortArray.toTypedArray(): Array<Short>

Returns a typed object array containing all of the elements of this primitive array.

actual inline fun <T> Collection<T>.toTypedArray(): Array<T>

Returns a typed array containing all of the elements of this collection.

actual fun BooleanArray.toTypedArray(): Array<Boolean>
actual fun ByteArray.toTypedArray(): Array<Byte>
actual fun CharArray.toTypedArray(): Array<Char>
actual fun DoubleArray.toTypedArray(): Array<Double>
actual fun FloatArray.toTypedArray(): Array<Float>
actual fun IntArray.toTypedArray(): Array<Int>
actual fun LongArray.toTypedArray(): Array<Long>
actual fun ShortArray.toTypedArray(): Array<Short>

Returns a typed object array containing all of the elements of this primitive array.

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

Returns a typed object array containing all of the elements of this primitive array.

actual inline fun <T> Collection<T>.toTypedArray(): Array<T>

Returns a typed array containing all of the elements of this collection.

toUByteArray
Link copied to clipboard
fun Array<out UByte>.toUByteArray(): UByteArray

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

Since Kotlin

1.3
inline fun ByteArray.toUByteArray(): UByteArray

Returns an array of type UByteArray, which is a copy of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3

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

Since Kotlin

1.3
toUIntArray
Link copied to clipboard
fun Array<out UInt>.toUIntArray(): UIntArray

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

Since Kotlin

1.3
inline fun IntArray.toUIntArray(): UIntArray

Returns an array of type UIntArray, which is a copy of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3

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

Since Kotlin

1.3
toULongArray
Link copied to clipboard
fun Array<out ULong>.toULongArray(): ULongArray

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

Since Kotlin

1.3
inline fun LongArray.toULongArray(): ULongArray

Returns an array of type ULongArray, which is a copy of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3

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

Since Kotlin

1.3
toUShortArray
Link copied to clipboard
fun Array<out UShort>.toUShortArray(): UShortArray

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

Since Kotlin

1.3
inline fun ShortArray.toUShortArray(): UShortArray

Returns an array of type UShortArray, which is a copy of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin

1.3

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

Since Kotlin

1.3
union
Link copied to clipboard
infix fun <T> Array<out T>.union(other: Iterable<T>): Set<T>
infix fun BooleanArray.union(other: Iterable<Boolean>): Set<Boolean>
infix fun ByteArray.union(other: Iterable<Byte>): Set<Byte>
infix fun CharArray.union(other: Iterable<Char>): Set<Char>
infix fun DoubleArray.union(other: Iterable<Double>): Set<Double>
infix fun FloatArray.union(other: Iterable<Float>): Set<Float>
infix fun IntArray.union(other: Iterable<Int>): Set<Int>
infix fun LongArray.union(other: Iterable<Long>): Set<Long>
infix fun ShortArray.union(other: Iterable<Short>): Set<Short>
infix fun <T> Iterable<T>.union(other: Iterable<T>): Set<T>

Returns a set containing all distinct elements from both collections.

unzip
Link copied to clipboard
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.

fun <T, R> Iterable<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 collection, second list is built from the second values of each pair from this collection.

windowed
Link copied to clipboard
fun <T> Iterable<T>.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false): List<List<T>>

Returns a list of snapshots of the window of the given size sliding along this collection with the given step, where each snapshot is a list.

Since Kotlin

1.2
fun <T, R> Iterable<T>.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (List<T>) -> R): List<R>

Returns a list of results of applying the given transform function to an each list representing a view over the window of the given size sliding along this collection with the given step.

Since Kotlin

1.2
withDefault
Link copied to clipboard
fun <K, V> Map<K, V>.withDefault(defaultValue: (K) -> V): Map<K, V>

Returns a wrapper of this read-only map, having the implicit default value provided with the specified function defaultValue.

@JvmName(name = "withDefaultMutable")
fun <K, V> MutableMap<K, V>.withDefault(defaultValue: (K) -> V): MutableMap<K, V>

Returns a wrapper of this mutable map, having the implicit default value provided with the specified function defaultValue.

withIndex
Link copied to clipboard
fun <T> Array<out T>.withIndex(): Iterable<IndexedValue<T>>
fun BooleanArray.withIndex(): Iterable<IndexedValue<Boolean>>
fun ByteArray.withIndex(): Iterable<IndexedValue<Byte>>
fun CharArray.withIndex(): Iterable<IndexedValue<Char>>
fun DoubleArray.withIndex(): Iterable<IndexedValue<Double>>
fun FloatArray.withIndex(): Iterable<IndexedValue<Float>>
fun IntArray.withIndex(): Iterable<IndexedValue<Int>>
fun LongArray.withIndex(): Iterable<IndexedValue<Long>>
fun ShortArray.withIndex(): Iterable<IndexedValue<Short>>

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.

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.

Since Kotlin

1.3
fun <T> Iterable<T>.withIndex(): Iterable<IndexedValue<T>>

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

fun <T> Iterator<T>.withIndex(): Iterator<IndexedValue<T>>

Returns an Iterator that wraps each element produced by the original iterator into an IndexedValue containing the index of that element and the element itself.

zip
Link copied to clipboard
infix fun <T, R> Array<out T>.zip(other: Array<out R>): List<Pair<T, R>>
infix fun <R> BooleanArray.zip(other: Array<out R>): List<Pair<Boolean, R>>
infix fun BooleanArray.zip(other: BooleanArray): List<Pair<Boolean, Boolean>>
infix fun <R> ByteArray.zip(other: Array<out R>): List<Pair<Byte, R>>
infix fun ByteArray.zip(other: ByteArray): List<Pair<Byte, Byte>>
infix fun <R> CharArray.zip(other: Array<out R>): List<Pair<Char, R>>
infix fun CharArray.zip(other: CharArray): List<Pair<Char, Char>>
infix fun <R> DoubleArray.zip(other: Array<out R>): List<Pair<Double, R>>
infix fun DoubleArray.zip(other: DoubleArray): List<Pair<Double, Double>>
infix fun <R> FloatArray.zip(other: Array<out R>): List<Pair<Float, R>>
infix fun FloatArray.zip(other: FloatArray): List<Pair<Float, Float>>
infix fun <R> IntArray.zip(other: Array<out R>): List<Pair<Int, R>>
infix fun IntArray.zip(other: IntArray): List<Pair<Int, Int>>
infix fun <R> LongArray.zip(other: Array<out R>): List<Pair<Long, R>>
infix fun LongArray.zip(other: LongArray): List<Pair<Long, Long>>
infix fun <R> ShortArray.zip(other: Array<out R>): List<Pair<Short, R>>
infix fun ShortArray.zip(other: ShortArray): List<Pair<Short, Short>>

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.

infix fun <T, R> Array<out T>.zip(other: Iterable<R>): List<Pair<T, R>>
infix fun <R> BooleanArray.zip(other: Iterable<R>): List<Pair<Boolean, R>>
infix fun <R> ByteArray.zip(other: Iterable<R>): List<Pair<Byte, R>>
infix fun <R> CharArray.zip(other: Iterable<R>): List<Pair<Char, R>>
infix fun <R> DoubleArray.zip(other: Iterable<R>): List<Pair<Double, R>>
infix fun <R> FloatArray.zip(other: Iterable<R>): List<Pair<Float, R>>
infix fun <R> IntArray.zip(other: Iterable<R>): List<Pair<Int, R>>
infix fun <R> LongArray.zip(other: Iterable<R>): List<Pair<Long, R>>
infix fun <R> ShortArray.zip(other: Iterable<R>): List<Pair<Short, 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.

infix fun <R> UByteArray.zip(other: Array<out R>): List<Pair<UByte, R>>
infix fun UByteArray.zip(other: UByteArray): List<Pair<UByte, UByte>>
infix fun <R> UIntArray.zip(other: Array<out R>): List<Pair<UInt, R>>
infix fun UIntArray.zip(other: UIntArray): List<Pair<UInt, UInt>>
infix fun <R> ULongArray.zip(other: Array<out R>): List<Pair<ULong, R>>
infix fun ULongArray.zip(other: ULongArray): List<Pair<ULong, ULong>>
infix fun <R> UShortArray.zip(other: Array<out R>): List<Pair<UShort, R>>
infix fun UShortArray.zip(other: UShortArray): List<Pair<UShort, UShort>>

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.

Since Kotlin

1.3
infix fun <R> UByteArray.zip(other: Iterable<R>): List<Pair<UByte, R>>
infix fun <R> UIntArray.zip(other: Iterable<R>): List<Pair<UInt, R>>
infix fun <R> ULongArray.zip(other: Iterable<R>): List<Pair<ULong, R>>
infix fun <R> UShortArray.zip(other: Iterable<R>): List<Pair<UShort, 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.

Since Kotlin

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

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

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

Returns a list of pairs built from the elements of this collection and other collection 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: (T, R) -> V): List<V>
inline fun <R, V> BooleanArray.zip(other: Array<out R>, transform: (a: Boolean, R) -> V): List<V>
inline fun <R, V> ByteArray.zip(other: Array<out R>, transform: (a: Byte, R) -> V): List<V>
inline fun <R, V> CharArray.zip(other: Array<out R>, transform: (a: Char, R) -> V): List<V>
inline fun <R, V> DoubleArray.zip(other: Array<out R>, transform: (a: Double, R) -> V): List<V>
inline fun <R, V> FloatArray.zip(other: Array<out R>, transform: (a: Float, R) -> V): List<V>
inline fun <R, V> IntArray.zip(other: Array<out R>, transform: (a: Int, R) -> V): List<V>
inline fun <R, V> LongArray.zip(other: Array<out R>, transform: (a: Long, R) -> V): List<V>
inline fun <R, V> ShortArray.zip(other: Array<out R>, transform: (a: Short, 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.

inline fun <T, R, V> Array<out T>.zip(other: Iterable<R>, transform: (T, R) -> V): List<V>
inline fun <R, V> BooleanArray.zip(other: Iterable<R>, transform: (a: Boolean, R) -> V): List<V>
inline fun <R, V> ByteArray.zip(other: Iterable<R>, transform: (a: Byte, R) -> V): List<V>
inline fun <R, V> CharArray.zip(other: Iterable<R>, transform: (a: Char, R) -> V): List<V>
inline fun <R, V> DoubleArray.zip(other: Iterable<R>, transform: (a: Double, R) -> V): List<V>
inline fun <R, V> FloatArray.zip(other: Iterable<R>, transform: (a: Float, R) -> V): List<V>
inline fun <R, V> IntArray.zip(other: Iterable<R>, transform: (a: Int, R) -> V): List<V>
inline fun <R, V> LongArray.zip(other: Iterable<R>, transform: (a: Long, R) -> V): List<V>
inline fun <R, V> ShortArray.zip(other: Iterable<R>, transform: (a: Short, 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.

inline fun <V> BooleanArray.zip(other: BooleanArray, transform: (a: Boolean, b: Boolean) -> V): List<V>
inline fun <V> ByteArray.zip(other: ByteArray, transform: (a: Byte, b: Byte) -> V): List<V>
inline fun <V> CharArray.zip(other: CharArray, transform: (a: Char, b: Char) -> V): List<V>
inline fun <V> DoubleArray.zip(other: DoubleArray, transform: (a: Double, b: Double) -> V): List<V>
inline fun <V> FloatArray.zip(other: FloatArray, transform: (a: Float, b: Float) -> V): List<V>
inline fun <V> IntArray.zip(other: IntArray, transform: (a: Int, b: Int) -> V): List<V>
inline fun <V> LongArray.zip(other: LongArray, transform: (a: Long, b: Long) -> V): List<V>
inline fun <V> ShortArray.zip(other: ShortArray, transform: (a: Short, b: Short) -> 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 array.

inline fun <R, V> UByteArray.zip(other: Array<out R>, transform: (a: UByte, R) -> V): List<V>
inline fun <R, V> UIntArray.zip(other: Array<out R>, transform: (a: UInt, R) -> V): List<V>
inline fun <R, V> ULongArray.zip(other: Array<out R>, transform: (a: ULong, R) -> V): List<V>
inline fun <R, V> UShortArray.zip(other: Array<out R>, transform: (a: UShort, 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.

Since Kotlin

1.3
inline fun <V> UByteArray.zip(other: UByteArray, transform: (a: UByte, b: UByte) -> V): List<V>
inline fun <V> UIntArray.zip(other: UIntArray, transform: (a: UInt, b: UInt) -> V): List<V>
inline fun <V> ULongArray.zip(other: ULongArray, transform: (a: ULong, b: ULong) -> V): List<V>
inline fun <V> UShortArray.zip(other: UShortArray, transform: (a: UShort, b: UShort) -> 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 array.

Since Kotlin

1.3
inline fun <R, V> UByteArray.zip(other: Iterable<R>, transform: (a: UByte, R) -> V): List<V>
inline fun <R, V> UIntArray.zip(other: Iterable<R>, transform: (a: UInt, R) -> V): List<V>
inline fun <R, V> ULongArray.zip(other: Iterable<R>, transform: (a: ULong, R) -> V): List<V>
inline fun <R, V> UShortArray.zip(other: Iterable<R>, transform: (a: UShort, 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.

Since Kotlin

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

Returns a list of values built from the elements of this collection 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.

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

Returns a list of values built from the elements of this collection 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.

zipWithNext
Link copied to clipboard
fun <T> Iterable<T>.zipWithNext(): List<Pair<T, T>>

Returns a list of pairs of each two adjacent elements in this collection.

Since Kotlin

1.2
inline fun <T, R> Iterable<T>.zipWithNext(transform: (T, T) -> R): List<R>

Returns a list containing the results of applying the given transform function to an each pair of two adjacent elements in this collection.

Since Kotlin

1.2

Properties

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

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val ByteArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val ShortArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val IntArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val LongArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val FloatArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val DoubleArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val BooleanArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val CharArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val UIntArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val ULongArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val UByteArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val UShortArray.indices: IntRange

Returns the range of valid indices for the array.

indices
Link copied to clipboard
val Collection<*>.indices: IntRange

Returns an IntRange of the valid indices for this collection.

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

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val ByteArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val ShortArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val IntArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val LongArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val FloatArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val DoubleArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val BooleanArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val CharArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val UIntArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val ULongArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val UByteArray.lastIndex: Int

Returns the last valid index for the array.

lastIndex
Link copied to clipboard
val UShortArray.lastIndex: Int

Returns the last valid index for the array.

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

Returns the index of the last item in the list or -1 if the list is empty.