Collection.isNullOrEmpty()

String class has the very useful “String?.isNullOrEmpty()” (and friends) – why not Collection?

It’s simple enough to hack together such a utility function for your own use. And if you feel really strongly that it should be in the standard library, that’s what pull requests are for :smiley:

Yeah, I’ve done so for my project, but it feels generally useful. Partly just wanted to check that there wasn’t some reason I’m missing why this doesn’t exist already.

Fair enough. Perhaps the community ought to start something akin to Guava… shared util functions that perhaps ought to be in the std lib, but without necessarily having to go through the rigor of making that happen. Goodness knows I’ve got a half dozen things I could throw into a project like that…

1 Like

Were you behind the proposal?

FTR: kotlin.collections.isNullOrEmpty