How to convert string to integer?

im making a program that reads from console and converts the string value into integer .

How should i proceed ?

1 Like

https://doc.rust-lang.org/std/primitive.str.html#method.parse

3 Likes

Another option is https://doc.rust-lang.org/std/primitive.i32.html#method.from_str_radix

2 Likes