📜  kotlin 字符串转 int - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:34.884000             🧑  作者: Mango

代码示例2
val mystring: String = "999"
try {
    val parsedValue = mystring.toInt()
    println("The parsed integer value is $parsedInt")
} catch (nfe: NumberFormatException) {
    // not a valid int
}