But then, you can do a really dirty trick :slightl...
# announcements
o
But then, you can do a really dirty trick 🙂
Copy code
data class Country private constructor(val iso: String) {
    companion object {
        operator fun invoke(iso: String) = Country(iso.toLowerCase())
    }
}

fun main(args: Array<String>) {
    val us = Country("US")
    println(us)
}