0
Someone help me to convert from string to integer in Kotlin
B
6 Antworten
+ 3
Please remove code link in post's tags and put Kotlin in, as the language relevant to the question.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 2
var x="5"
var num = Integer.parseInt(x)
println(num)
+ 1
Thank you guys. I appreciate it
0
Here are other ways
https://tedblob.com/kotlin-convert-string-to-int/
0
The readline function is for user input. If you've already declared the variables, you don't have to redeclare them.
Also, don't forget the ending curly bracket for the main function.