0
How to change the string into an integer ...
5 Respostas
+ 7
Specify a relevant language name in the tags ☝
This is something done in variius ways differed by language.
+ 5
∆BH∆Y I think you meant
a = "12345"
a = int(a)
The OP asked for string to int, not int to string.
In Java, what seems to be the only language course you're taking, you can do something like;
String n = "12345";
int num = Integer.parseInt(n);
// Or
Integer num = Integer.valueOf(n)
parseInt() will return an value with type int, where valueOf() will return an Integer object.
0
It's correct