Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to convert string to int android studio kotlin

fun main(args: Array<String>) {
    for (str in args) {
        try {
            val parsedInt = str.toInt()
            println("The parsed int is $parsedInt")
        } catch (nfe: NumberFormatException) {
            // not a valid int
        }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #string #int #android #studio #kotlin
ADD COMMENT
Topic
Name
3+7 =