I have the following code:
fun qwer(vararg x: String){
}
fun main() {
qwer()
}
As you can see i can pass 0 strings to qwer
function. Is there a way to make qwer
function get at least one argument ?
You could do something like this:
fun qwer(first: String, vararg x: String) {
}
So, calling qwer()
errors out but qwer("hello")
is fine.
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