I have a string that contains a number in the octal system. Now I'd like to convert this String to an integer. I found text.parse()
which converts the string into an integer with radix 10.
How do I convert the String to a number given a radix? (Ideally a solution that works for hexadecimal/decimal/binary/octal, and not only for octal)
Asked
Active
Viewed 3,946 times
4

Ian Rehwinkel
- 2,486
- 5
- 22
- 56
-
1[`from_str_radix`](https://doc.rust-lang.org/std/primitive.i64.html#method.from_str_radix) – Shepmaster Jul 08 '19 at 14:03