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 2,531 times
3
Ian Rehwinkel
- 2,229
- 2
- 18
- 49
-
[`from_str_radix`](https://doc.rust-lang.org/std/primitive.i64.html#method.from_str_radix) – Shepmaster Jul 08 '19 at 14:03