Kotlin字符串转Int类型报错

Kotlin整数字符串调用toInt()方法报错NumberFormatException

解决方法

先转换成Double,在转换成Int

("6").toDouble().toInt()

猜你喜欢

转载自blog.csdn.net/xiaopihair123/article/details/131810986
今日推荐