ArrayCompanion<T> extension

on

Properties

indices Iterable<int>

Available on Array<T>, provided by the ArrayCompanion extension

no setter
lastIndex int

Available on Array<T>, provided by the ArrayCompanion extension

no setter
size int

Available on Array<T>, provided by the ArrayCompanion extension

no setter

Methods

all(bool predicate(T)) bool

Available on Array<T>, provided by the ArrayCompanion extension

Returns true if all elements match the given predicate.
chunked(int size) List<List<T>>

Available on Array<T>, provided by the ArrayCompanion extension

containsAll(Iterable<T> elements) Boolean

Available on Array<T>, provided by the ArrayCompanion extension

contentToString() String

Available on Array<T>, provided by the ArrayCompanion extension

Returns a string representation of the contents of the specified array as if it is List.
count(bool predicate(T)?) int

Available on Array<T>, provided by the ArrayCompanion extension

Returns the number of elements matching the given predicate.
distinct() Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a list containing only distinct elements from the given array.
drop(int n) Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a list containing all elements except first n elements.
dropLast(int n) Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a list containing all elements except last n elements.
filter(bool predicate(T)) Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a list containing only elements matching the given predicate.
filterIndexed(bool predicate(int, T)) Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a list containing only elements matching the given predicate.
filterNot(bool predicate(T it)) Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a list containing only elements matching the given predicate.
find(bool predicate(T? it)) → T?

Available on Array<T>, provided by the ArrayCompanion extension

Returns the first element matching the given predicate, or null if no such element was found.
findLast(bool predicate(T? it)) → T?

Available on Array<T>, provided by the ArrayCompanion extension

Returns the last element matching the given predicate, or null if no such element was found.
get(int index) → T

Available on Array<T>, provided by the ArrayCompanion extension

getOrElse(int index, T defaultValue(int)) → T

Available on Array<T>, provided by the ArrayCompanion extension

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.
getOrNull(int index, T defaultValue(int)) → T?

Available on Array<T>, provided by the ArrayCompanion extension

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.
groupBy<K, V>(K keySelector(Any?), V valueTransform(Any?)?) Map<K, V>

Available on Array<T>, provided by the ArrayCompanion extension

indexOfFirst(bool predicate(T?)) Int

Available on Array<T>, provided by the ArrayCompanion extension

Returns index of the first element matching the given predicate, or -1 if the array does not contain such element.
intersect(Iterable<T> other) Set<T>

Available on Array<T>, provided by the ArrayCompanion extension

Returns a set containing all elements that are contained by both this array and the specified collection.
joinToString({String separator = ', ', String prefix = '', String postfix = '', Int limit = -1, String truncated = '...', String transform(T)?}) String

Available on Array<T>, provided by the ArrayCompanion extension

minus(Iterable<T> elements) List<T>

Available on Array<T>, provided by the ArrayCompanion extension

minusElement(T element) List<T>

Available on Array<T>, provided by the ArrayCompanion extension

none({bool predicate(T)?}) bool

Available on Array<T>, provided by the ArrayCompanion extension

Returns true if no elements match the given predicate.
onEach(void action(T)) Iterable<T>

Available on Array<T>, provided by the ArrayCompanion extension

Performs the given action on each element and returns the collection itself afterwards.
partition(bool predicate(T)) → (List<T>, List<T>)

Available on Array<T>, provided by the ArrayCompanion extension

plus(Iterable<T> elements) List<T>

Available on Array<T>, provided by the ArrayCompanion extension

plusElement(T element) List<T>

Available on Array<T>, provided by the ArrayCompanion extension

requireNoNulls() Iterable<T?>

Available on Array<T>, provided by the ArrayCompanion extension

set(int index, T value) → void

Available on Array<T>, provided by the ArrayCompanion extension

shuffled(Random random) List<T>

Available on Array<T>, provided by the ArrayCompanion extension

singleOrNull(Boolean test(T? it)) → T?

Available on Array<T>, provided by the ArrayCompanion extension

Returns single element, or null if the array is empty or has more than one element.
toTypedArray() Array<T>

Available on Array<T>, provided by the ArrayCompanion extension

union(Iterable<T> others) Set<T>

Available on Array<T>, provided by the ArrayCompanion extension

withIndex() Iterable<int>

Available on Array<T>, provided by the ArrayCompanion extension

Operators

operator [](int index) → dynamic

Available on Array<T>, provided by the ArrayCompanion extension

operator []=(int index, T value) → void

Available on Array<T>, provided by the ArrayCompanion extension