KtCollectionExtensions<T> extension

on

Methods

isNotEmpty() bool

Available on KtCollection<T>, provided by the KtCollectionExtensions extension

Returns true if the collection is not empty.
random([Random? random]) → T

Available on KtCollection<T>, provided by the KtCollectionExtensions extension

Returns a random element from this collection.
randomOrNull([Random? random]) → T?

Available on KtCollection<T>, provided by the KtCollectionExtensions extension

Returns a random element from this collection.
sumOf<R extends num>(R selector(T)) → R

Available on KtCollection<T>, provided by the KtCollectionExtensions extension

Returns the sum of all elements in this collection.
toMutableList() KtMutableList<T>

Available on KtCollection<T>, provided by the KtCollectionExtensions extension

Returns a KtMutableList filled with all elements of this collection.