single
Returns the single element, or throws an exception if the array is empty or has more than one element.
@ExperimentalUnsignedTypes inline fun ULongArray.single(
predicate: (ULong) -> Boolean
): ULong
(source)
@ExperimentalUnsignedTypes inline fun UByteArray.single(
predicate: (UByte) -> Boolean
): UByte
(source)
@ExperimentalUnsignedTypes inline fun UShortArray.single(
predicate: (UShort) -> Boolean
): UShort
(source)
Returns the single element matching the given predicate, or throws exception if there is no or more than one matching element.
Returns the single element, or throws an exception if the collection is empty or has more than one element.