How to convert a String to an Int in Kotlin?

devquora
devquora

Posted On: Feb 22, 2018

 

toInt() method is used to convert a string value to integer or INT in Kotlin. Below is example uses

fun main(args: Array) {
    val s: String = "Kotlin"
    var x = 10
    x = "8".toInt()
}

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Kotlin Interview Questions

    Which type of Programming does Kotlin support?

    Which type of Programming does Kotlin support?..