Join Slack
Powered by
You could always go for `val a: Int? = try { parse...
# announcements
t
trubesv
09/18/2017, 9:51 PM
You could always go for
val a: Int? = try { parseInt(input) } catch (e: NumberFormatException) { null }
as showed here:
https://kotlinlang.org/docs/reference/exceptions.html#try-is-an-expression
➕ 2
Open in Slack
Previous
Next