📌  相关文章
📜  如何将字符串转换为 int android studio kotlin - Java 代码示例

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

代码示例1
fun main(args: Array) {
    for (str in args) {
        try {
            val parsedInt = str.toInt()
            println("The parsed int is $parsedInt")
        } catch (nfe: NumberFormatException) {
            // not a valid int
        }
    }
}