inline fun <T> Array<out T>.isNotEmpty(): Boolean
inline fun ByteArray.isNotEmpty(): Boolean
inline fun ShortArray.isNotEmpty(): Boolean
inline fun IntArray.isNotEmpty(): Boolean
inline fun LongArray.isNotEmpty(): Boolean
inline fun FloatArray.isNotEmpty(): Boolean
inline fun DoubleArray.isNotEmpty(): Boolean
inline fun BooleanArray.isNotEmpty(): Boolean
inline fun CharArray.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.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val empty = emptyList<Any>()
println("empty.isNotEmpty() is ${empty.isNotEmpty()}") // false
val collection = listOf('a', 'b', 'c')
println("collection.isNotEmpty() is ${collection.isNotEmpty()}") // true
//sampleEnd
}
inline fun <K, V> Map<out K, V>.isNotEmpty(): Boolean
Returns true
if this map is not empty.
© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/is-not-empty.html