ValV
inline fun <reified T> convert(text: String): Any? { return try { text to T // something bad is happening here } catch (e: Exception) { null } }
sandi
text as T
text.toInt()
T
Int
gcx11
when (T::class)
A modern programming language that makes developers happier.