4 ms·
Alternative way to count the vowels in Kotlin: val numVowels = countVowels(getDTO()?.string ?: "")
by rnentjes 5y ago
Alternative way to count the vowels in Kotlin:
val numVowels = countVowels(getDTO()?.string ?: "")
- ptx 5y agoOr alternatively, closer to the original, doing both null checks the same way the original does the first one: val numVowels = getDTO()?.string?.let(::countVowels) ?: 0