none
Returns true
if the char sequence has no characters.
Samples
import samples.*
import kotlin.test.*
fun main() {
//sampleStart
val emptyList = emptyList<Int>()
assertTrue(emptyList.none())
val nonEmptyList = listOf("one", "two", "three")
assertFalse(nonEmptyList.none())
//sampleEnd
}
Returns true
if no characters match the given predicate.
Samples
import samples.*
import kotlin.test.*
fun main() {
//sampleStart
val isEven: (Int) -> Boolean = { it % 2 == 0 }
val zeroToTen = 0..10
assertFalse(zeroToTen.none { isEven(it) })
assertFalse(zeroToTen.none(isEven))
val odds = zeroToTen.map { it * 2 + 1 }
assertTrue(odds.none { isEven(it) })
val emptyList = emptyList<Int>()
assertTrue(emptyList.none { true })
//sampleEnd
}