i'm trying to create a silly function which takes ...
# getting-started
t
i'm trying to create a silly function which takes a string and a class, then converts the string to that class:
Copy code
fun cast(str: String, clazz: Class<*>) = when {
    clazz is Int -> str.toInt()
}
but i'm having some trouble with what exactly i'm supposed to compare