At the moment I have this fun:
private fun validateArguments(city: String, state: String, country: String, zip: String): List<String> {
val list: MutableList<String> = mutableListOf()
if (city.isNullOrBlank()) list.add("Invalid city")
if (state.isNullOrBlank()) list.add("Invalid state")
if (country.isNullOrBlank()) list.add("Invalid country")
if (zip.isNullOrBlank()) list.add("Invalid zip code")
return list.toList()
}
and I was wondering if there a more elegent way to create the list. The final list could also be a MutableList I guess.