Well, I'm doing a job for college where I need to identify the number of words a string has in Kotlin.
Type:
texto = "Ola Mundo"
The variable numeropalavra
s must be equal to 2.
Is there a function that checks the number of words, without having to cycle to check the letter to find the number of words?