📅  最后修改于: 2022-03-11 14:53:34.884000             🧑  作者: Mango
val mystring: String = "999"
try {
val parsedValue = mystring.toInt()
println("The parsed integer value is $parsedInt")
} catch (nfe: NumberFormatException) {
// not a valid int
}