How to check if a sequence is empty in Kotlin? What's the simplest way?
If you mean literally a Sequence
, use none()
without arguments for "is empty" and any()
for "is not empty".
For other collections, these method names work as well, but there's also
isNotEmpty()
. Strangely, there is isEmpty
, but only for arrays!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With