Johann Pardanaud
05/27/2024, 8:56 AMhashtags.each {
// Trim hashtags for leading "#", and only then ensure that it's not empty
map { it.trimStart('#') }.isNotEmpty()
}
New constraints:
// Validate the type of a value
someValue.isInstanceOf<String>()
// Validate elements are unique in a collection
someCollection.hasNoDuplicates()
It is now easier than ever to validate a specific index of a collection:
someCollection.first().isNotEmpty()
someCollection.last().isNotEmpty()
someCollection[index].isNotEmpty()
What's next? 🔜
Probably Kotlin 2.0 and KMP 😏